Arduino Prtotothreads without library
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();
}
}