Arduino MKR LowPower sleep(2000) takes 3seconds?

Hello,

Using this simple example:

#include "ArduinoLowPower.h"

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  LowPower.sleep(2000);
  digitalWrite(LED_BUILTIN, LOW);
  LowPower.sleep(2000);
}

The led flashes off/on with an interval of approximately 3 seconds while I have 2 seconds (2000ms) in my code.

If I change it to 3000ms it flashes with an interval of approximately 4 seconds.
And with a value between 0 and 1000 it flashes with an interval of 1 second.

Why is there a difference of 1 second and how can I make it sleep for example 250ms?

I'm using an arduino MKR

are you connected using USB ? could it be the boot loader waiting?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.