# Case 06: Create A Magic Wand ## Purpose --- - To create a magic wand with multiple functions. ## Materials --- ## Products Link --- [Magic Wand Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-magic-wand-kit-without-micro-bit-board?_pos=1&_sid=809c6b940&_ss=r) ## 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. ## Software --- [SoftwareMakeCode](https://makecode.microbit.org/#) ## Programming --- ### Programme as the picture shows: ![](./images/magicwand_case_06_07.png) ### link Linkļ¼[https://makecode.microbit.org/_b2PLoH8ADTxP](https://makecode.microbit.org/_b2PLoH8ADTxP) You can also download it directly:
### 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. ## Exploration --- ## FAQ --- ## Relevant File ---