Hi all,
I noticed that the function delayMicroseconds does not work (properly) on my Arduino Uno. It seems like the program skips the command altogether. For instance, in this simple program:
const int ledPin = 12;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delayMicroseconds(500000);
digitalWrite(ledPin, LOW);
delayMicroseconds(500000);
/*
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(500);
*/
}
the LED lights up at half capacity, as if it had a duty cycle of 50% (as you would expect when delayMicroseconds is being skipped). The normal delay function (in comments) works fine. A value of 500 ms in the delay function should be equivalent to 500000 µs in delayMicroseconds function, right? Anyone an idea what might be wrong?