Posts

Showing posts with the label LED

Arduino Traffic Light LED on Breadboard

Image
  Objective: Set up a traffic light LED automated system. Arrange the resisters in series. Code: void setup() {   // put your setup code here, to run once:   // GREEN PIN   pinMode(10, OUTPUT);   // YELLOW PIN   pinMode(7, OUTPUT);   // RED PIN   pinMode(3, OUTPUT); } void loop() {   // put your main code here, to run repeatedly:   // GREEN LED   digitalWrite(10, HIGH);   delay(10000);   digitalWrite(10, LOW);   delay(1000);   // YELLOW LED   digitalWrite(7, HIGH);   delay(1000);   digitalWrite(7, LOW);   delay(1000);   // RED LED   digitalWrite(3, HIGH);   delay(10000);   digitalWrite(3, LOW);   delay(1000); } Video: The presentation video is in the link below. LED Traffic Light - YouTube

Arduino LED

Image
Objective: Code the Arduino LED on pin 13 to generate a constant and alternating output. Alterations: Delete the two lines of delay(1000); code to produce a constant LED output. Code: void setup() {   // put your setup code here, to run once:   // Set pin 13 (LED) as the output.   pinMode(13, OUTPUT); } void loop() {   // put your main code here, to run repeatedly:   // Send signal to pin 13 to turn it on.    // Set it as HIGH means 5V or LOW to turn it off.   // Delay for 1000 ms (1 second)   // Turn the light for 1 ms and turn off for 1 ms in a loop.    // (Blinking LED)   digitalWrite(13, HIGH);   delay(1000);   digitalWrite(13, LOW);   delay(1000); } Video: The presentation video link is below. Arduino LED - YouTube