Arduino Prtotothreads without library

September 9, 2019 Josef Kubat Arduino 0 minutes, 9 seconds 337

Arduino Prtotothreads without protothread library

Code:

 unsigned long timestamp = 0;
 int interval = 1000; // =1s

 void loop()
 {
   if(millis() - timestamp > (unsigned long)interval) {
     timestamp = millis();
     //doSomething();
   }  
 }