headerphoto

How to turn on the led of arduino, which is call the led pin?




At the picture above, the led pin is marked as L and to turn it on is very easy, just

upload the sketch

bellow. If you success to upload the code (sketch), the led pin will turn on for 1 second, then turn off for 1 second, and roll it over again and again.


/****************************************/
/* ARDUINO SKETCH (1): BLINK, FLIP-FLOP */
/* TURN ON THE LED AT PIN 13 */
/****************************************/

#define led 13

void setup(){
pinMode(led, OUTPUT);
}

void loop(){
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}


Next→
←Prev

Related Articles

Choose label

Read more

No comments

No spam, no active link, please ^_^