i want the led to light at the beginning and stays like this for a while then turns off, so i wrote:
int led=13;
void setup() {
pinMode(led,OUTPUT);
}
void loop() {
digitalWrite(led,HIGH);
delay (5000);
digitalWrite (led,LOW);
}
as i understand it should start with high means on digitalWrite(led,HIGH)...and stays like this for 5000us delay (5000) then it should turn off with digitalWrite (led,LOW). but why its not working, it starts with off for afew seconds then stays on..what i understand wrong with these simple steps ????
void setup()
only once, then it runs all the code invoid loop()
and repeats running the code invoid loop()
over and over until you reset the arduino, or turn it off. .... if you want the arduino to do something only once then do not put the code invoid loop()