Étape 1 : Fais-le
Qu'est-ce que c'est ?
Transforme ta BBC micro:bit en une alerte pour bouteille d'eau, afin de savoir si quelqu'un d'autre y a bu. Tu apprendras comment utiliser l'écran LED et l'accéléromètre de la micro:bit.
Ces deux vidéos vous montrent ce que vous allez faire et comment le coder :
Comment ça marche
- The micro:bit shows a heart on its LED display when your water bottle is upright.
- The LED display shows a warning cross when a tilt is detected by the micro:bit’s accelerometer. The cross stays there until you reset the program by pressing the reset button on the back of the micro:bit or by disconnecting and reconnecting the battery.
- An accelerometer measures forces in three dimensions, including gravity, so your projects can tell which way up your micro:bit is.
Ce dont vous aurez besoin
- micro:bit (ou simulateur MakeCode)
- L'éditeur MakeCode
- boitier de piles
- our set-up guide may be useful
Étape 2 : Programme-le
Étape 3 : Améliore-le
- Find a way to reset the program without using the micro:bit’s reset button, for example by pressing button A or B to show a heart icon.
- Add an audible alarm using blocks from the music section of the MakeCode editor.