help needed
hi people
have problem , dont know how solve it.
my code this...
but goes in 1 direction.
this because of line...
it not work if (average) -#
how make (average) +# ??
thanks
have problem , dont know how solve it.
my code this...
code: [select]
{
if (average > 0)
{
dir = high;
}
else if (average < 0)
{
dir = low;
}
int i;
digitalwrite(dirpin, dir); // set direction.
delay(100);
for (i = 0; i<average; i++) // iterate 4000 microsteps.
{
digitalwrite(steppin, low); // low high change creates the
digitalwrite(steppin, high); // "rising edge" easydriver knows when step.
delaymicroseconds(200); // delay time close top speed this
} but goes in 1 direction.
this because of line...
code: [select]
for (i = 0; i<average; i++) it not work if (average) -#
how make (average) +# ??
thanks

Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > help needed
arduino
Comments
Post a Comment