A Beginner's Arduino Guide/Projects/Getting the LED to flash
Tools
General
Sister projects
In other projects
In this chapter, you will learn how to get the LED to flash on an Arduino board. This is one of the simplest projects that you can undertake.
// this runs only once on power upvoidsetup(){pinMode(13,OUTPUT);}// the loop function runs continuously until the device is powered downvoidloop(){digitalWrite(13,HIGH);// turn on LEDdelay(1000);// wait for a seconddigitalWrite(13,LOW);// turn off LEDdelay(1000);// wait for a second}