We will use the MakeCode popup: yes editor in the following challenges.
Turn the face into a heart:
Everything within the "forever" block is performed by the Calliope mini all the time, i.e. "forever". There are also other blocks that the Calliope mini can use to run programs. You will get to know them later.
Now look for the button "Download" . Click on it. This will save your program on the Calliope mini. The Calliope mini then executes your program permanently.
The Calliope mini shows you a beating heart all the time. At each heartbeat, the Calliope mini should now also display a text.
Pick the "show string" block from basics and put it into the "forever" loop.
A program is very easy to write. All you have to do is set the order on the computer: Action 1, Action 2, ...
The computer first makes action 1, then action 2... That means in the technical language sequence. Because of the "forever" block the program starts after the last action again at action 1. This is called an endless loop.
Change the text "Hello" to your own message. For example, you can have the Calliope mini write your own name or the name of a friend.
- Select the "on start" block from basic.
- Take the "show string" block out of the "forever" block and put it into the "on start" block.
The Calliope mini starts with the "on start" block. Everything inside this block will be done first by the Calliope mini, but not repeated afterwards. The "on start" block is executed only once (at start).
Find the reset button on the Calliope mini and press it. What happens?
Reset means "restart". This means that the Calliope mini starts the program again from the beginning.
- Select the "on button pressed" block from input.
- Replace the "on start" block with the "on button pressed" block.
Now you have learned what input means. You have created a program that reacts when you press the A button. Your program recognizes what you do with the Calliope mini: The program recognizes which button you press.
What do you have to do to make your message appear on the Calliope mini?
Press button A!
Can you get the Calliope mini to display different messages when you press different buttons?
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 InfoSphere popup: yes and translated into English by the Calliope team.