crwdns277196:0crwdne277196:0
crwdns277198:0crwdne277198:0
crwdns277200:0crwdne277200:0 crwdns277202:0crwdne277202:0
crwdns277204:0crwdne277204:0
crwdns277206:0crwdne277206:0
crwdns277208:0crwdne277208:0
- crwdns277210:0crwdne277210:0
- crwdns277212:0crwdne277212:0
- crwdns277214:0crwdne277214:0
crwdns277216:0crwdne277216:0
- crwdns277218:0crwdne277218:0
- crwdns277220:0crwdne277220:0
- crwdns277608:0crwdne277608:0 crwdns277610:0crwdne277610:0
- crwdns277612:0crwdne277612:0 crwdns277614:0crwdne277614:0
- crwdns277618:0crwdne277618:0
- crwdns277620:0crwdne277620:0 crwdns277622:0crwdne277622:0 crwdns277624:0crwdne277624:0
- crwdns277626:0crwdne277626:0 crwdns277628:0crwdne277628:0
- crwdns277630:0crwdne277630:0
crwdns277632:0crwdne277632:0
- crwdns277634:0crwdne277634:0
- crwdns277636:0crwdne277636:0
- crwdns277638:0crwdne277638:0
crwdns277640:0crwdne277640:0
1from microbit import *
2import random
3
4lit = True
5
6while True:
7 if microphone.was_event(SoundEvent.LOUD):
8 lit = not lit
9 sleep(500)
10 if lit:
11 display.show(Image(
12 "00900:"
13 "09990:"
14 "09990:"
15 "09990:"
16 "09990"))
17 sleep(150)
18 flicker = random.randint(1, 3)
19 if flicker != 2:
20 display.set_pixel(2,0,0)
21 display.set_pixel(flicker,0,9)
22 sleep(150)
23 else:
24 display.clear()
crwdns277642:0crwdne277642:0
- crwdns277644:0crwdne277644:0
- crwdns277646:0crwdne277646:0 crwdns277648:0crwdne277648:0 crwdns277650:0crwdne277650:0
- crwdns277652:0crwdne277652:0 crwdns277654:0crwdne277654:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.