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?
Support forum for MegunoLink
2 posts • Page 1 of 1
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.