Navigation

Arduino Prtotothreads alternative - without protothread library

Protothread alternative:

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

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

.