Hey guys im just new to c++ and ive been given an assignment which is a fair bit confusing, can some1 please help me out? mainly looking at the programing side of this assignment opposed to the actually physical testing on the work bench. im using borland c++ version 4.52.
traffic light project
1. develop write compile and test a c language program that will implement a simulated traffic light "t" intersection.
2. the "t" intersection has two traffic lights (tl1, tl2) with a red, amber and green led each. the main road is tl1 and the side road (the vertical part of the "t" is tl2)
3. a sensor (magnetic reed switch) in to be used on the side road.
4. verify the operation of the leds and connections using a multimeter and test leads.
5. wire up the board to the input/output board with the following connections. you can use the iotest program to verify the operation of the leds output and input
input (one only) port a bit 0 - car detected
outputs
port b bit 0 - tl1 red
port b bit 1 - tl1 amber
port b bit 2 - tl1 green
port b bit 3 - tl2 red
port b bit 4 - tl2 amber
port b bit 5 - tl2 green
program operation
tl1 (main road) is to remain at green with tl2 (side road) at red until a car arrives at the side road detector. after the car is detected for 10seconds tl1 will go amber for 2 seconds and then red. after tl1 has been at red for 2 seconds tl2 will change to green for 10 seconds, then go amber for 2 seconds and then red. after a further 2 seconds of tl2 at red, tl1 will go green and only then will the detection of cars at the side road be enabled for another cycle.
7. fully document your program. use digi_o.obj subprogram for your input and outputs. the commands ...inA(), outB() are available. you will need to refresh the outputs of the leds after an input read.
anything that i haven't outline or explained properly please ask me straight away
cheers Billy Bob