This circuit consists of an Arduino UNO microcontroller board interfaced with a two-pin red LED. The purpose of the circuit is to blink the LED on and off at a regular interval of one second. The LED's anode is connected to a digital output pin (D13) on the Arduino UNO, and the cathode is connected to the ground (GND) pin on the Arduino UNO. The Arduino UNO is programmed to toggle the D13 pin between high and low states, causing the LED to turn on and off.
/*
* Arduino UNO interfacing with LED
* This sketch will blink an LED connected to pin D13 of the Arduino UNO.
*/
void setup() {
// Initialize the digital pin D13 as an output.
pinMode(13, OUTPUT);
}
void loop() {
// Turn the LED on (HIGH is the voltage level)
digitalWrite(13, HIGH);
// Wait for a second
delay(1000);
// Turn the LED off by making the voltage LOW
digitalWrite(13, LOW);
// Wait for a second
delay(1000);
}
File Name: sketch.ino
This code configures pin D13 as an output in the setup()
function. The loop()
function then repeatedly turns the LED on and off, with one-second intervals between state changes. The digitalWrite()
function is used to set the pin high or low, and the delay()
function pauses the program for 1000 milliseconds (1 second) between each toggle.