problem with time limiting code using millis()
i have found some information using millis() time limiting application on forum, tried use it. but doesn't work, giving me error:
error: stray '\' in program in function 'void rotatorleft()':
here small portion code use it:
so goal script stop working after 90 sec, not blow motor, should never take long , wrong happening.
error: stray '\' in program in function 'void rotatorleft()':
here small portion code use it:
code: [select]
void rotatorleft() // left = high
{
unsigned long starttime = millis();
while (rotatorlevel <= (requestdegree) -3 && stoprotation !=1 && millis() - starttime < 90000 && rotatorlevel < 360) { digitalwrite(left_out, high); digitalwrite(power_out, high); readrotator(); serialrotatorsend();}
digitalwrite(power_out, low);
digitalwrite(left_out, low); requestdegree=0;
stoprotation = 1;
}
so goal script stop working after 90 sec, not blow motor, should never take long , wrong happening.
did edit code in word processor or 'smart' editor of sort might replace normal ascii minus sign sort of unicode dash? copy webpage might have done that? character in millis() - starttime looks minus sign else. delete , type minus sign , try recompile.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > problem with time limiting code using millis()
arduino
Comments
Post a Comment