Skip to content

crwdns342183:0crwdne342183:0

crwdns359932:0crwdne359932:0

crwdns338145:0crwdne338145:0 | MakeCode, Python | crwdns255566:0crwdne255566:0, crwdns255570:0crwdne255570:0, crwdns274472:0crwdne274472:0, crwdns274476:0crwdne274476:0 | crwdns258516:0crwdne258516:0, crwdns293292:0crwdne293292:0, crwdns293306:0crwdne293306:0

crwdns359876:0crwdne359876:0

crwdns359878:0crwdne359878:0

crwdns359880:0crwdne359880:0

crwdns359884:0crwdne359884:0

crwdns359886:0crwdne359886:0

crwdns359888:0crwdne359888:0

  • crwdns359890:0crwdne359890:0 crwdns359892:0crwdne359892:0
  • crwdns359894:0crwdne359894:0
  • crwdns359896:0crwdne359896:0
  • crwdns359898:0crwdne359898:0 crwdns359900:0crwdne359900:0
  • crwdns359902:0crwdne359902:0
  • crwdns359904:0crwdne359904:0

crwdns359906:0crwdne359906:0

  • crwdns359908:0crwdne359908:0

crwdns359910:0crwdne359910:0

1# Imports go at the top
2from microbit import *
3import music
4
5stepcount = 0
6steplength = 0.6
7display.show(0)
8music.play(['c4:4'])
9
10while True:
11    if button_a.is_pressed():
12        music.play(['c3:2'])
13        display.show(Image.HEART)
14        sleep(400)
15        stepcount += 1
16        display.clear()
17    if button_b.is_pressed():
18        display.scroll(stepcount*steplength)
19    if pin_logo.is_touched():
20        display.scroll(stepcount)

crwdns359912:0crwdne359912:0

  • crwdns359914:0crwdne359914:0
  • crwdns359916:0crwdne359916:0
  • crwdns359918:0crwdne359918:0
  • crwdns359920:0crwdne359920:0 crwdns359922:0crwdne359922:0