-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
55 lines (55 loc) · 952 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
let Temp = input.temperature()
LCD1IN8.LCD_ClearBuf(0)
LCD1IN8.LCD_Init()
LCD1IN8.LCD_Clear()
LCD1IN8.LCD_SetBL(553)
LCD1IN8.DisNumber(
0,
0,
Temp,
LCD1IN8.LCD_Color(COLOR.GREEN)
)
LCD1IN8.DirectDisString(
0,
0,
" Celsius",
LCD1IN8.LCD_Color(COLOR.GREEN)
)
LCD1IN8.DisNumber(
0,
20,
input.lightLevel(),
LCD1IN8.LCD_Color(COLOR.YELLOW)
)
LCD1IN8.DirectDisString(
0,
20,
" Light ",
LCD1IN8.LCD_Color(COLOR.YELLOW)
)
LCD1IN8.DisNumber(
0,
40,
input.soundLevel(),
LCD1IN8.LCD_Color(COLOR.RED)
)
LCD1IN8.DirectDisString(
0,
40,
" Sound ",
LCD1IN8.LCD_Color(COLOR.RED)
)
LCD1IN8.LCD_Display()
basic.forever(function () {
if (Temp < 24) {
basic.showIcon(IconNames.Confused)
} else if (Temp < 27) {
basic.showIcon(IconNames.Happy)
} else if (Temp < 30) {
basic.showIcon(IconNames.Silly)
} else if (Temp < 33) {
basic.showIcon(IconNames.Asleep)
} else {
basic.showIcon(IconNames.Skull)
}
})