20 lessons · Learn by making
Crack the Code: from first blink to your own inventions
Learn physical computing with the Crack the Code shield and traffic light: a guided path through lights, sensors, sound and creative inventions.
Start with the shield tour, then work through the activities in order. Each lesson includes a complete program in the English IDE, an explanation, experiments and checks. Keep the same shield connected as you move from one idea to the next.
The activity progression is inspired by Get (On) With It by Peter Mahony and James Oliver. These lessons and programs are newly adapted for the two-button Crack the Code shield and its traffic-light module.
-
Start here
1Meet your Crack the Code shield
Connect your shield, find its inputs and outputs, and learn how to run and change a program in the English IDE.
Beginner · 20 minutes
-
Light and patterns
2Your first blink
Make the shield respond, then explain the repeating sequence behind a blinking LED.
Beginner · 20 minutes
-
3
Make your own light rhythm
Choose an LED and design a recognisable pattern using time.
Beginner · 20 minutes
-
4
Two lights, one sequence
Make two outputs take turns and use a timing table to predict their behaviour.
Beginner · 20 minutes
-
Sensing and response
5Read the knob
Turn a physical control into numbers and estimate its centre-pin voltage.
Beginner · 25 minutes
-
6
Turn the knob, dim the light
Scale a sensor reading and discover how fast switching controls LED brightness.
Beginner · 25 minutes
-
7
Bounce between two lights
Use thresholds and memory to select an output without needing a perfect sensor reading.
Beginner · 25 minutes
-
8
Measure changing light
Investigate the light sensor and collect a useful calibration range.
Beginner · 25 minutes
-
9
Build an automatic night light
Calibrate a light sensor and prevent flickering with two switching thresholds.
Beginner · 25 minutes
-
Inputs and memory
10Press to light
Read the shield’s button and make an output follow your hand.
Beginner · 25 minutes
-
11
Make a button remember
Turn a momentary press into an on/off switch, and learn why clean button events need debouncing.
Beginner · 25 minutes
-
Sound
12Give the shield a voice
Make two clear beeps and separate pitch, note length and the silence between sounds.
Beginner · 20 minutes
-
13
Turn the dial to bend a note
Use the potentiometer to choose a pitch, and the button to decide when the buzzer should sound.
Beginner · 25 minutes
-
14
Compose a tiny tune
Store an original melody as lists of pitches and note lengths, then play it once for each button press.
Intermediate · 30 minutes
-
Build a project
15Roll an electronic die
Combine a debounced button, a timed light chase, a dial and a pseudo-random result from one to six.
Intermediate · 40 minutes
-
16
Hear and see the light level
Calibrate two light conditions, show the range on six LEDs and turn brightness into a beep rate.
Intermediate · 40 minutes
-
17
Paint a message with moving light
Turn six LEDs into the columns of a tiny persistence-of-vision sign and design your own pattern.
Intermediate · 35 minutes
-
Beyond the shield
18Connect and blink an external LED
Build a simple output circuit with one LED, a series resistor and three individual connections.
Beginner · 30 minutes
-
19
Build a pedestrian crossing
Request a crossing with D7, sequence vehicle lights, and add Australian-style audible pedestrian feedback.
Intermediate · 30 minutes
-
20
Build a seven-key spoon piano
Make foil keys into digital switches, play a scale and bend the pitch with the onboard dial.
Intermediate · 45 minutes