-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
30 lines (30 loc) · 1.23 KB
/
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
input.onButtonPressed(Button.A, function () {
music.playSoundEffect(music.builtinSoundEffect(soundExpression.spring), SoundExpressionPlayMode.UntilDone)
basic.showString("temp")
basic.showNumber(envirobit.getTemperature())
if (envirobit.getTemperature() < 18) {
music.playSoundEffect(music.builtinSoundEffect(soundExpression.sad), SoundExpressionPlayMode.UntilDone)
basic.showIcon(IconNames.Sad)
basic.pause(1000)
basic.clearScreen()
} else if (envirobit.getTemperature() > 24) {
music.playSoundEffect(music.builtinSoundEffect(soundExpression.giggle), SoundExpressionPlayMode.UntilDone)
basic.showIcon(IconNames.Angry)
basic.pause(1000)
basic.clearScreen()
} else {
music.playSoundEffect(music.builtinSoundEffect(soundExpression.twinkle), SoundExpressionPlayMode.UntilDone)
for (let index = 0; index < 5; index++) {
basic.showIcon(IconNames.Heart)
basic.pause(500)
basic.showIcon(IconNames.SmallHeart)
basic.pause(500)
}
basic.clearScreen()
}
})
input.onButtonPressed(Button.B, function () {
basic.showString("light")
basic.showNumber(envirobit.getLight())
basic.clearScreen()
})