hi i have an Arduino uno
i have put a led in gnd and digital 13
i have write the code but not work delay(1000)
why?
int pin = 13;
void setup() {
pinMode (pin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(pin,HIGH);
delay(1000);
digitalWrite(pin,LOW);
}
No, the delay works fine. You need to understand your code better. You are setting the pin HIGH, then delaying 1s, then setting it LOW and immediately HIGH again (for only a few microseconds is the pin ever LOW).
Completely unnecessary any way, the uno has an onboard LED on pin 13. Probably following a tutororial for a dawn-of-time arduino which had a resistor built in for pin 13 but no LED.