Blink led light using Arduino r3

Here's a simple guide to get you started with a blinking LED project using Arduino:

Components Needed
- Arduino Board (e.g., Arduino Uno)
- LED
- Resistor (220-ohm or suitable for your LED)
- Breadboard and jumper wires

Circuit Setup
1. Connect the LED's anode (long leg) to a digital pin on the Arduino (e.g., pin 13).
2. Connect the LED's cathode (short leg) to one end of the resistor.
3. Connect the other end of the resistor to a GND pin on the Arduino.

Code
void setup() {
  pinMode(13, OUTPUT); // Set pin 13 as output
}

void loop() {
  digitalWrite(13, HIGH); // Turn LED on
  delay(1000); // Wait 1 second
  digitalWrite(13, LOW); // Turn LED off
  delay(1000); // Wait 1 second
}
How it Works
1. The `setup()` function sets the LED pin as an output.
2. The `loop()` function repeatedly turns the LED on and off with a 1-second delay between each state change.

Upload and Enjoy!
Upload the code to your Arduino board, and the LED should start blinking! 😊

Do you have any questions about this project or would you like to explore more complex projects?

Popular posts from this blog

Temperature sensor using Arduino Uno

Ir sensor using Arduino