Tux Crossing

Our first GPIO example will start from the very basics and build up a UK Pelican Crossing simulator using 5 x LEDs (A Red, Yellow and Green and another Red and Green for the Red and Green “man” indicators), 5 x 270Ω resistors and a single push-button for the pedestrians to control the lights.

Here is a picture of the finished board, but we’ll build it up in stages as we go, and finally present some software to make it all work:

The Finished Tx Crossing

The Finished Tux Crossing

 In the photo, all the LEDs are on. This was just to test the connections – it would not normally be like that when running the controlling program!

  1. The first LED
  2. Two more LEDs
  3. Final Assembly
  4. Software

Video Demo:


Tux Crossing — 8 Comments

    • Glad you’re having fun! that’s the same SKPang kit I’m using, but I bought directly off their site rather than via amazon.


  1. Is it possible to set the default behaviour of a pin so that it will work on boot without needing to set the mode?

    Many thanks,

    • You can set the pull-up/down behaviour, but you can’t set the mode (in/out) or the level for an output – most pins on most Pi’s default to input on power-up.


  2. Looks very nice, but is it possible to place a delay from when the button is pressed and when the lights change?