Programme

Support forum for MegunoLink
Post Reply
Jeannot
Posts: 1
Joined: Wed Aug 19, 2015 9:31 pm

Wed Sep 16, 2015 3:47 am

Hi
In the example found in: http: //www.megunolink.com/documentation/plotti ... reference/ I do not understand why the statement: LastSent = millis (); on line 16 is repeated on line 28?

Jeannot
philr
Posts: 359
Joined: Mon May 26, 2014 10:58 am

Sat Sep 19, 2015 4:20 am

Hi, the first in the Setup function just initializes LastSent with a sensible value. The loop function is continuously called and after 200mS (SendInterval) the if statement is executed. LastSent is set again to the current time so the if statement doesn't execute again until 200mS later. If it was not set the if statement would continue to run every time around the loop, not ever 200mS.

Cheers
Phil
Post Reply