WELCOME

Please use this bar to navigate

Pseudo Code



Function (when sensors hit)

Green.off
Red.on

-20 seconds -

do while < 10 seconds
if Amber.on { Amber.off}           //flashes
else { Amber.on} + 3seconds

Red.off
Green.on

- WAIT -

-------------------------------------------------------------------------------------------

The code above is what would be ran when the person activates the sensor, it would chance from a green light to a red light (in actual fact traffic lights would light up the amber light and then change from green and amber to red)...after a delay the red light would change to a red and flashing amber later becoming green again. This was done during a experiment at college where we had to work out the lighting system of traffic lights and time them etc. this was handy as at the time i was taking my driving test and needed the information to pass.

-------------------------------------------------------------------------------------------
Binary Colours:
(000011)
(001100)
(110000)
-------------------------------------------------------------------------------------------

The binary colours above could be used when colour coding or referencing the bulbs, the numbers do not stand for actual colours but instead the position of the LED we want to light up or turn from 0 to 1.

Any LED's can be used for this even a traffic light on the street could be programmed by this sensor and would probably look better too but the idea is still the same either way.

No comments:

Post a Comment