- This topic has 5 replies, 4 voices, and was last updated 12 years, 3 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › I need assistance
i am working on an 4-way cross road intelligent traffic light controller as my final year project and am using 8051 microcontroller. i want to be able to sense the first car that obstructs my input sensor(cause am using an infrared transmitter and receiver as sensors) the assign right of way to that lane of the road. then the second car to trip it is given the next right. but the microcontroller ought to check this 4 roads simultenously the arrange the cars(i.e road to be given right of way) in order of priority.BUT I CANT DRAW THE FLOWCHART THAT WOULD ENABLE ME WRITE THE CODE. HELP!!!!!
This is a very easy task. First you should write a code for reading the IR receiver output.
IT is your wish that you are going to read the first sensor output then checking the status of vehicles or reading all the sensors at a glance then checking the status.
Once the status is read, You can switch on respective traffic lights.
if ur sensors gives a sigle bit output, program should read it as a nibble (four bit data) from an input port,
according to the nibble read, program can give right of way to perticular road.
i think simultaneous reading is better control option.
i would like to make this microcontroller to read the outputs from these sensors simulteneously but i dont know how to structure the flowchart that would enable me write the code.
What you need to do is , first you should write a code to understand that where, which color lights should be switched ‘ON’.
You can write seperate sub programs (functions) say, void left(void), void rignt(void), void straight(void), void (back).
in each function you should write code to get the data from your look-up table.
once the data is taken you can just send it to the port where your light is connected.
thanks all. your advice was ok