Arduino UNO Tutorial 1 - Flashing LED
Arduino UNO Tutorial 1 - Flashing LED
This Arduino UNO Flashing LED tutorial is a basic 'Introduction to Arduino' tutorial and shows how to simply flashes the LED that is on the Arduino UNO board. The Arduino UNO already has an led and resistor connected to output pin 13, so we will use that. No other components are required.
/* Flashing LED * ------------ * * Turns on and off a light emitting diode(LED) connected to a digital * pin, in intervals of 2 seconds. * */ int ledPin = 13; // LED connected to digital pin 13 void setup() { pinMode(ledPin, OUTPUT); // sets the digital pin as output } void loop() { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second }