Login

Back

A Pelican crossing

traffic lightRoads can be dangerous places. A pedestrian crossing is a place in a road where we can cross in relative safety. We've all used them regularly since we were little to help us keep safe and in fact, they come in all kinds of formats in the UK. These are a Zebra crossing, a Pelican crossing, a Puffin crossing, a Toucan crossing and a Pegasus crossing. Pedestrian crossings all work sliightly differently from each other, depending on what type they are and also where they are situated. We are going to model a Pelican crossing in Python 3. 

To model a Pelican crossing, we need seven components. These are:

     1. a red light
     2. a yellow (amber) light
     3. a green light
     4. a wait light
     5. a red man
     6. a green man
     7. a buzzer.

Next, we need to really understand how a Pelican crossing works. We can't model anything unless we can agree on exactly what it is we are modelling and how it works. We have to be able to write this down very clearly so that everyone understands the description, with no possibility of misinterpreting it. Any lack of clarity on our part will lead to chaos, confusion and a lot of work correcting things!

As already mentioned, there are not only different types of crossing but each type may vary very slightly from others of the same type. We are going to use the following description of how a Pelican crossing works as the foundations of our model. 

Comment Red light Yellow light Green light Wait light Red man Green man Buzzer
Cars going normally along road. Off Off On Off On Off  Off
The button is pressed and you wait. Off Off On On On Off  Off 
Eventually, the lights start to change. Off On (2 secs) Off  On On  Off  Off 
Now you can start to cross. On   Off Off  Off  Off  On (flashes)  Beeps 
After 5 seconds, the lights start to change. Off On (flashes)  Off  Off  Off On (flashes)  Off 
Cars going normally along road. Off  Off  On  Off  On  Off  Off 
               

 Now that we have a description of how the Pelican crossing works, we can start work on the model.

Q1. Look up on the Internet information about a Zebra crossing, a Pelican crossing, a Puffin crossing, a Toucan crossing and a Pegasus crossing. How do they differ?
Q2. Find a Pelican crossing near you. Does the above description match how the Pelican crossing near you operates?  

Back