Adding machine

Adding machine

Throw the ball in the cup and score points! A fun way to learn how to add integers.


30 mins

from 8 years on


Integers can be tricky! But why not make a fun game and let a micro-controller help you add and subtract?

Required hardware components
1 x Calliope mini
1 x jumper wires (generic)

Additional things you need
egg cartons
four plastic cups
tin foil
flexible thin conducting wire


Calliope has 4 output pins (0, 1, 2 and 3) and a GND pin (-). The four cups are connected to the four different pins and the a ball (made of tin foil) is connected to the GND pin using a long thin flexible conducting wire.

Every time the ball is thrown in the cup, the circuit is completed to perform the desired actions.

Four cups are positioned one behind another in cup holder and Calliope mini is attached in the front (using double sided tape) to display the score.


With the metal pins insert it into the bottom of each cup (tip pointing inside the cup). Using wires connect each cup to the Calliope pins.

Make sure the contacts are not loose and the wires do not touch each other. Turn some tin foil into a ball and use long conducting metal wire to connect it to the GND pin.

Your hardware is ready!


The program is such that the nearest cup increases the point by 2, farthest by 5. The second cup adds 1 to the score but the third cup subtracts 3.

A screenshot of the code can be seen below:

A short visual demonstration can be seen here popup: yes.

This text as well as the images were published under a CC BY-SA 3.0 DE license popup: yes. It was originally published in German popup: yes
by Team Codiviti and edited by the Calliope team.

You can find the finished file below.

The program can be opened directly with the MakeCode editor.