crwdns275502:0crwdne275502:0
crwdns275504:0crwdne275504:0
crwdns275506:0crwdne275506:0
crwdns275508:0crwdne275508:0
crwdns275510:0crwdne275510:0
crwdns275512:0crwdne275512:0
- crwdns355720:0crwdne355720:0 crwdns275516:0crwdne275516:0
crwdns275518:0crwdne275518:0
- crwdns275520:0crwdne275520:0
- crwdns275522:0crwdne275522:0
- crwdns275524:0crwdne275524:0
- crwdns275526:0crwdne275526:0
crwdns275528:0crwdne275528:0
- crwdns355722:0crwdne355722:0
- crwdns275532:0crwdne275532:0
- crwdns275534:0crwdne275534:0
crwdns275536:0crwdne275536:0
1from microbit import *
2import audio
3
4while True:
5 if accelerometer.was_gesture('shake'):
6 display.show(Image.SURPRISED)
7 audio.play(Sound.GIGGLE)
8 if accelerometer.was_gesture('up'):
9 display.show(Image.HAPPY)
10 audio.play(Sound.HELLO)
11 if accelerometer.was_gesture('down'):
12 display.show(Image.ASLEEP)
13 audio.play(Sound.YAWN)
14 if accelerometer.was_gesture('left'):
15 display.show(Image.ARROW_W)
16 audio.play(Sound.SLIDE)
17 if accelerometer.was_gesture('right'):
18 display.show(Image.ARROW_E)
19 audio.play(Sound.SOARING)
20
crwdns275538:0crwdne275538:0
- crwdns355724:0crwdne355724:0
- crwdns355726:0crwdne355726:0
- crwdns275544:0crwdne275544:0
- crwdns275546:0crwdne275546:0
- crwdns275548:0crwdne275548:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.