Circuit Documentation
Summary
This circuit consists of an Arduino UNO microcontroller, a resistor, and a red LED. The Arduino UNO is programmed to blink the LED on and off with a delay of one second. The resistor is used to limit the current flowing through the LED to prevent damage.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Resistor
- Description: A passive electrical component that implements electrical resistance as a circuit element.
- Pins: pin1, pin2
- Properties:
- Resistance: 200 Ohms
LED: Two Pin (red)
- Description: A light-emitting diode that emits red light.
- Pins: cathode, anode
Wiring Details
Arduino UNO
- GND: Connected to the cathode of the LED.
- D5: Connected to pin2 of the resistor.
Resistor
- pin1: Connected to the anode of the LED.
- pin2: Connected to D5 of the Arduino UNO.
LED: Two Pin (red)
- cathode: Connected to GND of the Arduino UNO.
- anode: Connected to pin1 of the resistor.
Code Documentation
void setup() {
// put your setup code here, to run once:
pinMode(5, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
delay(1000);
}
Code Explanation
- setup(): This function runs once when the microcontroller is powered on or reset. It sets pin 5 as an output.
- loop(): This function runs repeatedly after the setup function. It turns the LED on by setting pin 5 to HIGH, waits for one second, turns the LED off by setting pin 5 to LOW, and waits for another second. This creates a blinking effect for the LED.
