SHARE
TWEET

Untitled

a guest Apr 25th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // library imports
  2.  
  3. // global variables
  4.  
  5. void setup() {
  6.   Serial.begin(9600);
  7.   Serial.println("Initializing...");
  8.  
  9.   // setup
  10. }
  11.  
  12. void loop() {
  13.   Serial.println("Running...");
  14.  
  15.   // local main event loop variables
  16.  
  17.   uint32_t lastMillis = millis();
  18.   while (true) {
  19.     uint32_t currentMillis = millis();
  20.     if (currentMillis < lastMillis) {
  21.       // skip main loop in case of millis() overflow
  22.       continue;
  23.     }
  24.  
  25.     // main event loop actions
  26.  
  27.     lastMillis = currentMillis;
  28.   }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top