04-05-2015, 09:57 AM
That information helps Chuck.
Looking at the code:
The rotation function gets passed a negative number via ToMove.
The rotation function:
has a "for" loop who's counter is compared to that negative number. I don't think the counter will ever be less than that negative number so the loop won't ever run. I think Arvid needs to verify that since it makes my brain hurt.
Ed
Looking at the code:
Code:
if(Degrees < 0)
{
ToMove = (Degrees*Multiplier)*-1;
lcd.setCursor(0,0);
lcd.print("REV");
lcd.print(abs(Degrees),2);
lcd.print((char)223);
lcd.setCursor(8,1);
lcd.print("Moving");
rotation(ToMove,0);
lcd.setCursor(8,1);
lcd.print(" ");
}
The rotation function gets passed a negative number via ToMove.
The rotation function:
Code:
void rotation(float tm, int d)
{
if(d == 0)
{
digitalWrite(dir, LOW);
}
else
{
digitalWrite(dir, HIGH);
}
for(int i = 0; i < tm; i++)
{
digitalWrite(stp, HIGH);
delay(stepdelay);
digitalWrite(stp, LOW);
delay(stepdelay);
}
}
has a "for" loop who's counter is compared to that negative number. I don't think the counter will ever be less than that negative number so the loop won't ever run. I think Arvid needs to verify that since it makes my brain hurt.
Ed