Video thumbnail for Arduino Intro: 4 LEDs 2 Pins, 2 LEDs 1 Pin

Arduino Intro: 4 LEDs 2 Pins, 2 LEDs 1 Pin

Dec 22, 2023
Arduino Intro Logo

Arduino Intro

Verified Open.Video Creator Badge
Arduino sketch: /* 4 LEDs 2 Pins 1. Turn on the first pair of LEDs and turn off the other pair of LEDS at the same time, for 1 second. 2. Turn off the first pair of LEDs and turn on the other pair of LEDS at the same time, for 1 second. 3. Repeat */ int pinLED1=9,pinLED2=5; void setup() { // put your setup code here, to run once: pinMode(pinLED1,OUTPUT); pinMode(pinLED2,OUTPUT); } void loop() { // put your main code here, to run repeatedly: digitalWrite(pinLED1,LOW); digitalWrite(pinLED2,HIGH); delay(1000); digitalWrite(pinLED1,HIGH); digitalWrite(pinLED2,LOW); delay(1000); }
Computers & Electronics