-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
30 lines (30 loc) · 1008 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
basic.forever(function () {
if (input.temperature() < 15) {
basic.setLedColor(0x0000ff)
basic.showString("< 15")
} else if (input.temperature() < 18) {
basic.setLedColor(0xff9da5)
basic.showString("< 18")
} else if (input.temperature() < 20) {
basic.setLedColor(0xffff00)
basic.showString("< 20")
} else if (input.temperature() < 22) {
basic.setLedColor(0x7f00ff)
basic.showString("< 22")
} else if (input.temperature() < 24) {
basic.setLedColor(0x00ff00)
basic.showString("< 24")
} else if (input.temperature() < 26) {
basic.setLedColor(0x65471f)
basic.showString("< 26")
} else if (input.temperature() < 28) {
basic.setLedColor(0x00ffff)
basic.showString("< 28")
} else if (input.temperature() < 17) {
basic.setLedColor(0x000000)
basic.showString("< 17")
} else {
basic.setLedColor(0xff0000)
basic.showString("> 28")
}
})