Want to know your fortune? Then all you need is a micro:bit and a bit of time.

 

The code in the picture is actually quite simple. When the micro:bit is shaken, it generates a random number and uses it to pick a message. After the message is finished, it says “8” to show that it is ready for another try.

Download your code to your micro:bit.

Challenge

Can you add some more messages? Remember, you will have to increase the number in the pick random part.

Advertisements