certainly that’s where Id start, as its an easy test…

something like

void setup() {
... your code... 
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
...  your code...



  static long prevT = 0;
  static const long blinkT=5000;

  unsigned long currT = millis();
  digitalWrite(LED_BUILTIN, (currT-prevT)>=blinkT ? HIGH : LOW );
  if(currT-prevT>=(blinkT+100)) prevT=currT; 
}

this example will just shortly blink (100ms) every 5 seconds, but only if your code is still executing the main the loop

1 Like