# Balance Challenge with Calliope mini

## In this game the Calliope will be balanced and give an error message as soon as it is not well balanced.

#### from 8 years on

Use the position sensor and let the LED on the Calliope light up red if it is not in the right position.

## Solution

Instead of turning off the LED, you could of course give it a different color.
Or, instead of the coloured LED, you can use the display to indicate a tilted position.

1. So far, the Calliope has checked its position only once. Directly after program starts.
With a loop you make sure that it is checked again and again.
2. You can also install a warning tone and let a red LED light up longer, so that errors can be recognized more clearly.

## Solution

You can already play your Calliope game.
The next tasks will explain how to use angles to determine the position of the Calliope more precisely and thus increase the difficulty.

3Bonus Task: Change Difficulty

With the gyroscope you can also measure how many degrees the calliope is tilted.

1. Switch off the LED if the Calliope is tilted less than 20° forward or backward.
2. For this we need the X-value. If you combine it with the absolute value, you don't have to differentiate whether the calliope is tilted forwards or backwards.

## Solution

4Bonus Task: Change Difficulty

Now we also have to check the tilting to the right and left.
We measure this with the Y-value. If the calliope is lying on the table, the value is -179° or +179°.

The LED should also be switched off if the absolute value is greater than 160°.

## Solution

If you use a smaller number (but a minimum of 0) instead of 20 and a larger number (but a maximum of 179) instead of 160, the game becomes more difficult.

This text as well as the images are published under a CC BY-SA 3.0 DE license popup: yes. It was originally published in German popup: yes by TüftelAkademie popup: yes and translated into English by the Calliope team.

hex xml