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:

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

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums