-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
40 lines (39 loc) · 926 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
input.onButtonPressed(Button.A, function () {
if (note != 1) {
note = note - 1
basic.showString("" + (note))
}
})
input.onSound(DetectedSound.Loud, function () {
})
input.onButtonPressed(Button.B, function () {
if (note != 7) {
note = note + 1
basic.showString("" + (note))
}
})
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
if (note == 1) {
music.ringTone(262)
} else if (note == 2) {
music.ringTone(294)
} else if (note == 3) {
music.ringTone(330)
} else if (note == 4) {
music.ringTone(349)
} else if (note == 5) {
music.ringTone(392)
} else if (note == 6) {
music.ringTone(440)
} else {
music.ringTone(494)
}
})
let note = 0
note = 1
basic.showString("" + note + "do")
basic.forever(function () {
if (input.soundLevel() > 120) {
music.stopAllSounds()
}
})