7. Case 06: Create A Magic Wand#

7.1. Purpose#


  • To create a magic wand with multiple functions.

7.2. Materials#


7.4. Background#


In case of any emergencies and incidents, Xiao En decides to set all the functions to the magic wand. Only in this way can he and his team use the magic power in a quick way and also succeed in the trial.

7.5. Software#


SoftwareMakeCode

7.6. Programming#


Programme as the picture shows:#

../../_images/magicwand_case_06_07.png

Result#


  • [x] After powering on, the strip lights in blue and the functions can be switched from pressing button A/B or tilting the micro:bit. After pressing button A, it shows a smile face; after pressing button B, it switches to the recharging mode, if the LEDs are all in red, they can turn to blue by pressing the button connecting to P2; while tilting the micro:bit to the right side, it switches to the function of beating over the spider or letting the flying saucer take off; while tilting to the micro:bit to the left side, it switches to the function of sending “land off” command to the flying saucer; after setting the magic functions ready, press the button connecting to P2 to release the magic, kindly note that the last blue LED will turn to red each time after you release the magic power, which means the magic power doens’t work if there is no blue LED lighting on, at this time you will have to recharge your magic wand to start this function and kindly note only all the LEDs turn to blue will the recharging be finished or it fails to recharge with the strip in red.

7.7. Exploration#


7.8. FAQ#


7.9. Relevant File#