Aim Traffic Signal Simulation (This program is example for digital read and digital write) Hardware Required Arduino Board LEDs Resistors 10 K – board Pin Configuration Arduino Switch LED Pin 13 (through resistor) + of RED LED Pin 12 (through resistor) + (Anode) of YELLOW LED Pin 11 (through resistor) + (Anode) of GREEN LED GND - (Cathode of all 3 LEDs) 5V Switch Input D0 Switch output Circuit Diagram Code // defining variables so that we can address the lights by name rather than a number int red = 13; int yellow = 12; int green = 11; // add the setup function, where’ll we define the red, yellow and green LEDs to be output mode
Aim Traffic Signal Simulation (This program is example for digital read and digital write) Hardware Required Arduino Board LEDs Resistors – 10 K board Pin Configuration Arduino Switch LED Pin 13 (through resistor) + of RED LED Pin 12 (through resistor) + (Anode) of YELLOW LED Pin 11 (through resistor) + (Anode) of GREEN LED GND - (Cathode of all 3 LEDs) 5V Switch Input D0 Switch output Circuit Diagram Code // defining variables so that we can address the lights by name rather than a number int red = 13; int yellow = 12; int green = 11; // add the setup function, where’ll we define the red, yellow and green LEDs to be output mode
Sensorinterfacingprogarm-2.docx