This Arduino project demonstrates the basic functionality of blinking two LEDs alternately using the Arduino IDE. Both LEDs blink on and off with a one-second interval.
- Clone this repository to your local machine using
git clone https://github.com/shivaganesht/Arduino-Double-LED-Blinking-Code.git
. - Open the project in the Arduino IDE.
Connect two LEDs to the Arduino board as follows:
- Connect one leg of the first LED to pin 13 on the Arduino board.
- Connect the other leg of the first LED to ground (GND) on the Arduino board.
- Connect one leg of the second LED to pin 12 on the Arduino board.
- Connect the other leg of the second LED to ground (GND) on the Arduino board.
- Connect your Arduino board to your computer.
- Upload the code to your Arduino board. If you're unsure how to upload code to your Arduino board, refer to the Arduino documentation.
- Both LEDs will start blinking alternately with a one-second interval.
void setup()
{
pinMode(LED_BUILTIN, OUTPUT); // Set the built-in LED pin as an output
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED on
delay(1000); // Wait for one second
digitalWrite(LED_BUILTIN, LOW); // Turn the LED off
delay(1000); // Wait for one second
}
This project provides a simple example of blinking two LEDs alternately with Arduino. Feel free to modify the code and experiment with different blinking patterns!
This project is licensed under the MIT License - see the LICENSE file for details.