I'm playing with the built-in blink example, and am confused about why things are working as they are. In the following code snippet:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(4000); // wait for a second
}
I would expect this to light up the LED, wait for 1 sec, then turn it off and wait for 4 sec. However, the opposite is true. It lights up, stays lit for 4 seconds, then turns off and waits for 1 second.
I a little bit feel like I'm going crazy here. Why is it reverse of what I expect?