crwdns339955:0crwdne339955:0
crwdns339957:0crwdne339957:0
crwdns339959:0crwdne339959:0
crwdns339963:0crwdne339963:0
- crwdns339965:0crwdne339965:0
- crwdns339967:0crwdne339967:0
- crwdns339969:0crwdne339969:0
- crwdns339971:0crwdne339971:0
- crwdns339973:0crwdne339973:0 crwdns339975:0crwdne339975:0
- crwdns339977:0crwdne339977:0
crwdns339979:0crwdne339979:0
- crwdns339981:0crwdne339981:0
- crwdns339983:0crwdne339983:0
- crwdns339985:0crwdne339985:0
- crwdns339987:0crwdne339987:0
crwdns339989:0crwdne339989:0
1from microbit import *
2import music
3F = 349
4A = 440
5C = 523
6E = 659
7
8while True:
9 if pin1.is_touched():
10 music.pitch(int(F), 500)
11 music.pitch(int(A), 500)
12 music.pitch(int(C), 500)
13 if pin2.is_touched():
14 music.pitch(int(A), 500)
15 music.pitch(int(C), 500)
16 music.pitch(int(E), 500)
17 if button_a.was_pressed():
18 F = F / 2
19 A = A / 2
20 C = C / 2
21 E = E / 2
22 if button_b.was_pressed():
23 F = F * 2
24 A = A * 2
25 C = C * 2
26 E = E * 2
27
crwdns339991:0crwdne339991:0
- crwdns339993:0crwdne339993:0
- crwdns339995:0crwdne339995:0 crwdns339997:0crwdne339997:0
- crwdns339999:0crwdne339999:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.