Skip to content

crwdns342183:0crwdne342183:0

crwdns328192:0crwdne328192:0

crwdns338145:0crwdne338145:0 | MakeCode, Python | crwdns255566:0crwdne255566:0, crwdns274474:0crwdne274474:0 | crwdns258500:0crwdne258500:0, crwdns258502:0crwdne258502:0, crwdns258504:0crwdne258504:0

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
crwdns277616:0crwdne277616: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