Question

In: Computer Science

Design and implement a functional traffic light using a push button to act as a cross...

Design and implement a functional traffic light using a push button to act as a cross walk. Components one RGB LED Lights, two 330 ohm resistor, POT, Temperature Sensor, Arduino, and a bread board Description: Use a POT and a Temperature Sensor to enable the Red and Green Legs of and RGB LED. RGB LEDs have three legs the (R)ed, (G)reen and (B)leu legs. c programming language

Solutions

Expert Solution

void setup() {

// configure the output pins

pinMode(2,OUTPUT);

pinMode(3,OUTPUT);

pinMode(4,OUTPUT);

pinMode(5,OUTPUT);

pinMode(6,OUTPUT);

pinMode(7,OUTPUT);

pinMode(8,OUTPUT);

pinMode(9,OUTPUT);

pinMode(10,OUTPUT);

}

void loop()

{

digitalWrite(2,1); //enables the 1st set of signals

digitalWrite(7,1);

digitalWrite(10,1);

digitalWrite(4,0);

digitalWrite(3,0);  

digitalWrite(6,0);

digitalWrite(8,0);

digitalWrite(9,0);

digitalWrite(5,0);

delay(5000);

digitalWrite(3,1); //enables the yellow lights

digitalWrite(6,1);

digitalWrite(2,0);

digitalWrite(7,0);

delay(1000);

digitalWrite(4,1); //enables the 2nd set of signals

digitalWrite(5,1);

digitalWrite(10,1);

digitalWrite(2,0);

digitalWrite(3,0);  

digitalWrite(6,0);

digitalWrite(8,0);

digitalWrite(9,0);

digitalWrite(7,0);

delay(5000);

digitalWrite(9,1); //enables the yellow lights

digitalWrite(6,1);

digitalWrite(10,0);

digitalWrite(5,0);  

digitalWrite(4,0);

delay(1000);

digitalWrite(8,1); //enables the 3rd set of signals

digitalWrite(4,1);

digitalWrite(7,1);

digitalWrite(2,0);

digitalWrite(3,0);  

digitalWrite(5,0);

digitalWrite(6,0);

digitalWrite(9,0);

digitalWrite(10,0);

delay(5000);

digitalWrite(9,1); //enables the yellow lights

digitalWrite(3,1);

digitalWrite(7,0);

digitalWrite(8,0);

digitalWrite(4,0);

delay(1000);

}


Related Solutions

Construct a VI that uses a round push button control to turn on a square light...
Construct a VI that uses a round push button control to turn on a square light indicator whenever the push button is depressed. By using LABwiew software
Design an embedded system using MSP430 to control a traffic light system. It is included a...
Design an embedded system using MSP430 to control a traffic light system. It is included a complete design description of a traffic light system to help you in your design. Show the hardware schematics and the software needed to complete your design.
Design an automatic traffic light control signal for a road square using 1MHz internal oscillator of...
Design an automatic traffic light control signal for a road square using 1MHz internal oscillator of PIC16F887. Each traffic light must consist of three (Red, Yellow, Green) lights. Use proteus for implementation. Your code must use four light signals installed on each road connecting to square. in word program form.(text and diagram )
design 4 bit four way traffic light signal by using j k flip flop and 555...
design 4 bit four way traffic light signal by using j k flip flop and 555 timer ic state equation and k map and also schematic diagram.
For design, the daily car, pickup truck, and light van traffic is 20,000; and the daily...
For design, the daily car, pickup truck, and light van traffic is 20,000; and the daily truck traffic consists of 200 passes of single-unit trucks with single and tandem axles, and 410 passes of tractor semi-trailer trucks with single, tandem, and triple axles. The axle weights are :cars, pickups, light vans = two 2000-lb single axles;single-unit trucks = 10,000-lb steering, single axle= 22,000-lb drive, tandem axle and: tractor semi-trailer trucks = 12,000-lb steering, single axle,= 18,000-lb drive, tandem axle,= 50,000-lb...
Design a sequential traffic light controller for the intersection of street A and street B. Each...
Design a sequential traffic light controller for the intersection of street A and street B. Each street has traffic sensors which detect the presence of vehicles approaching or stopped at intersection. Sa=1 means a vehicle is approaching on street A. Sb=1 means a vehicle is approaching on street B. There are 3 outputs of each streets RedA, YellowA and GreenA, RedB, YellowB, and GreenB. Condition: “StreetA” is a main street and has a green light for at least 50s, after...
To implement target costing for a new product companies often set up cross functional teams with...
To implement target costing for a new product companies often set up cross functional teams with members from engineering, marketing and cost accounting. Why is a cross-functional team desirable when implementing the target costing approach?
To implement target costing for a new product companies often set up cross functional teams with...
To implement target costing for a new product companies often set up cross functional teams with members from engineering, marketing and cost accounting. Why is a cross-functional team desirable when implementing the target costing approach?
Please perform the following tasks using a Timer Control: When an NO Push Button (I:0/0) is...
Please perform the following tasks using a Timer Control: When an NO Push Button (I:0/0) is pressed (I0) and released, a Pilot Light (O:0/0) will be on and after 7 seconds (T4:0), a single-active cylinder will be pushed forward. The piston will remain at its position for another 5 seconds (T4:1) and then it will automatically retract. The pilot light will be off and the timer will also be automatically reset. The whole cycle can then be repeated.
Design a Traffic Light that upon reset, turns Red for 10 seconds, then Green for 10...
Design a Traffic Light that upon reset, turns Red for 10 seconds, then Green for 10 seconds, then Yellow for 5 seconds. Assume a CLK period of 5 seconds. Draw the State Transition Diagram, State Transition Table and Output Table, find the Boolean Equations for Next State and Output and draw the logic circuit.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT