Posts

Showing posts with the label Arduino LED Control

Arduino : Advanced Traffic Light Controller

  Arduino Advanced Traffic Light Controller: Objective: Create a traffic light controller that mimics the behavior of a real traffic light, including pedestrian signals. Components: Arduino board (e.g., Arduino Uno) Red, yellow, green LEDs for traffic lights Red, green LEDs for pedestrian signals Pushbuttons for pedestrian crossing request Resistors (220 ohms for LEDs, pull-down resistor for pushbuttons) Breadboard and jumper wires Circuit: Connect the LEDs for traffic lights and pedestrian signals to the appropriate digital pins on the Arduino using resistors. Connect pushbuttons for pedestrian crossing requests to digital pins with pull-down resistors. Code: // Traffic Light Controller with Pedestrian Signals const int trafficRed = 2 ; const int trafficYellow = 3 ; const int trafficGreen = 4 ; const int pedestrianRed = 5 ; const int pedestrianGreen = 6 ; const int pedestrianButton = 7 ; void setup ( ) { pinMode ( trafficRed , OUTPUT )