How to get an LED to blink on the Arduino board as well as on the breadboard by using the Arduino IDE.
Using the Arduino Sketch, a program is developed to make the onboard LED blink (see code below). Alternatively, an led can be wired from the Arduino (Arduino UNO in this example) to a breadboard that contains an LED and a 330 ohm resistor and the Sketch can refer to the pins on the Arduino, in this case, 12 and GND. Any GPIO (General Purpose Input/Output) pin can be used.
int LED = 13; // This number is changed to 12 for the breadboard example
void setup()
{
pinMode(LED, OUTPUT);
}
void loop()
{
digitalWrite(LED,HIGH);
delay(500);
digitalWrite(LED,LOW);
delay(500);
}
Response From: Patrick Hood-Daniel
Very good and focused clip of making an LED blink using an Arduino UNO. To speed up the blinking or slow it down, all you need to do is modify the delay number which is in milliseconds. Code below for a very fast example.
int LED = 13; // This number is changed to 12 for the breadboard example
void setup()
{
pinMode(LED, OUTPUT);
}
void loop()
{
digitalWrite(LED,HIGH);
delay(100);
digitalWrite(LED,LOW);
delay(100);
}
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.