timing problem with the arduino.


hello arduino friends.


i got strange problems arduino,

i want task every second. (this should near precisely)
so, wrote time function:

[font=courier]    aktuellezeit = millis();
   if(aktuellezeit > naechstezeit){
     standby();
     naechstezeit = millis() + closingtime;
   }[/font]

but problem now, doesnt rhythmic. value changes strangely. times, leasts 2 secs until starts task.

has idea how this?


thank you!!!

what standby() do? since you're checking millis() above call standby, again after it, you'll 2 different results millis() depending on how long standby takes complete.

replace first call millis() assignment temporary variable, , in second use variable instead of calling millis() again.


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > timing problem with the arduino.


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