
things you will need
The following items from the Discover Computing kit:
- 1 x Crumble
- 1 x Battery pack
- 1 x Sparkle baton
- 1 x Button switch
- 3 x Red croc leads, 2 x Black croc leads, 1 x Green croc lead, 1 x Yellow croc lead
- 1 x USB cable
A computer with a USB port and the Crumble software installed.
Plus,
- 1 x box
- 4 x colouring pens (different colours)
- Card and felt
- Sticky tape
- Scissors


Prepare the box
Use the scissors to make a hole in the middle of the box.
Use the scissors to make another hole in the bottom left-hand corner of the box.

Connect the Crumble to power
Use one red croc lead and one black croc lead to connect the Crumble to the battery box.
Safety first

Add the output
Attach one red croc lead, one black croc lead and one green croc lead to the connectors on the right hand side of the Crumble (as shown).
Push each croc lead (one at a time) through the hole in the middle of the box (keeping hold of their jackets).
Attach the croc leads to the connectors on the left hand side of the Sparkle baton (as shown).
Â
Need to know


Add the input
Attach one red croc lead to the remaining positive (+) connector on the battery box.
Attach one yellow croc lead to the A (input/output) connector on the Crumble.
Push each croc lead (one at a time) through the hole in the bottom left hand corner of the box.
Attach the croc leads to the button switch (as shown).
Secure the button switch so it lies flat against the box.

Make the chore board
Use some sticky tape to secure the Sparkle baton in place.
Draw a vertical line on the box after every second Sparkle.
Write the names of your family on the box above each group of two Sparkles.
Make a cover for the button switch using card or felt.
Secure the cover on top of the button switch using sticky tape.

Decide on the chores
Select four chores for you and your family.
Use the pens to create a colour coded chore chart.
Attach the chore chart to the box using sticky tape.

Connect the Crumble to a computer
Use the USB cable to connect your Crumble circuit to a computer with the Crumble software installed.

Code the Crumble - Create Suspense
Snap a ‘do forever’ loop to a program start block.
Tell the Crumble that IF the button is pressed (A is HI) THEN cycle the sparkles through the colours of the rainbow 3 times before turning all sparkles off.
Send your code to the Crumble and press the button on the chore board to test it out.


Code the Crumble - Variables
Create two variables – one called Person and one called Chore.
Assign the Person variable a random number between 0 and 7.
Assign the Chore variable a random number between 1 and 4.
Things to know
The random number assigned to the Person variable will indicate whose chore it is.
For example, if the number generated is 0 or 1 this would mean that the chore belongs to Dad.
The random number assigned to the Chore variable will indicate what chore it is.
For example, if the number generated is 1 then Dad needs to brush up.



Code the Crumble - Light Up the Sparkle
Next, you will need to tell the Crumble which Sparkle to light up and in what colour.
- Tell the Crumble that IF the Chore variable is equal to 1 THEN turn the Sparkle ON that:
- matches the random number generated for the Person variable; and
- set the colour to BLUE (or whichever colour you have selected for the first task on your chore chart) for 5 seconds.
ELSE
- Tell the Crumble that IF the Chore variable is equal to 2 THEN turn the Sparkle ON that:
- matches the random number generated for the Person variable; and
- set the colour to RED (or whichever colour you have selected for the first task on your chore chart) for 5 seconds.
ELSE
Repeat for chores 3 and 4 but use an IF – THEN – END IF block for chore 4.

Code the Crumble - Reset the Chore Board
Tell the Crumble to turn the Sparkle off (using a ‘turn all sparkles off’ block) to reset the chore board.

Set-up the chore board
Send the completed code to the Crumble using the green triangle.
Unplug the USB cable from the Crumble and close the box.
Press the button to try it out.
What chore did you get or did you escape this time?
Top tip
