void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13, LOW);
delay(1000);
digitalWrite(13, HIGH);
}
I have doubt after delay i tshould have to turn ON for long right, but it's turn OFF, if any one knows explain
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13,!digitalRead(13));
delay(1000);
}
1. Turn ON the LED. 2. Wait for a while so that the brightness of the LED is visible. 3. Turn OFF the LED. 4. Wait for a while so that the brightness of the LED is visible. 5. repeat from Step-1.
If you omit Step-4, you will not see that the LED is OFF though there is a code in Step-3 to turn OFF the LED. The control instantly goes to Step-1 and the LED is ON again.