Hi,
A strange phenomenon I am encountering with using the microbit V2 with Visual Studio Code using debug. It seems that the delay() function becomes very slow after a few seconds. The following demo program runs a blinking led for about 3 seconds with the expected delay of 1000 ms but gets down to about a delay of 60 seconds per blink after that. Somehow this has to do with using Visual Studio Code because if I run the same code without Visual Studio Code then the same code with the delay does not slow down. The led blinks at a rate of 1 second as expected then.
Any ideas what might be causing this behavior ?
Kind regards,
Rob van der Ouderaa
#include <Arduino.h>
#define ROW 25
#define COL 3
void setup() {
pinMode(ROW, OUTPUT);
digitalWrite(ROW, HIGH);
pinMode(COL, OUTPUT);
digitalWrite(COL, LOW);
}
void loop() {
digitalWrite(COL, LOW);
delay(1000); // wait for a second
digitalWrite(COL, HIGH);
delay(1000); // wait for a second
}