// #########################################
// External LED Interfacing
// #########################################
//
// Interface an LED to Arduino Nano (Hardware & Simulation)
//
// Check out the link for Code explanation and Hardware details
// Link:
// http://tech.arunkumarn.in/blogs/arduino-nano/interfacing-led-to-arduino-nano/
//
#define LED_1 10
#define LED_2 12
void setup() {
// Initialize LED as output PIN
pinMode(LED_1, OUTPUT);
pinMode(LED_2, OUTPUT);
}
void loop() {
// Turning ON External LED
digitalWrite(LED_1, HIGH); // HIGH Logic
digitalWrite(LED_2, LOW); // LOW Logic
delay(2000);
// Turning OFF External LED
digitalWrite(LED_1, LOW); // HIGH Logic
digitalWrite(LED_2, HIGH); // LOW Logic
delay(1000);
}
LED 1
R1
LED 2
R2
High Logic
Low Logic