Data Sheet
LESSON 1
| 21
void setup()
{
pinMode(3, OUTPUT);
}
void loop()
{
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
}
The void setup()
runs once when the Maker
UNO is powered on. The code in the void
setup() usually use to conīgure the pin as
INPUT or OUTPUT using pinMode();
The digitalWrite(3, HIGH); digital pin number
3 is set to HIGH which is to turn ON the LED
while the digitalWrite(3, LOW);
digital pin
number 3 is set to LOW which is to turn OFF
the LED.
The delay();
is a function to make the Maker
UNO from execute anything for the time set
in miliseconds. 1000 is equal to 1 second.
ARDUINO CODE
RESULT
LED is a light emitting diode. It will light up when a proper voltage is applied in correct
direction. LED will blink with a delay of 1 second.
*Note : The built-in LED on pin number 3 will also light up with a delay of 1 second.