File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
examples/tutorials/thread_network Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ int main(void) {
45
45
u8g2_SetFont (& u8g2 , u8g2_font_profont12_tr );
46
46
u8g2_SetFontPosTop (& u8g2 );
47
47
48
+ // Enable buttons
48
49
for (int i = 0 ; i < 4 ; i ++ ) {
49
50
libtock_button_notify_on_press (i , button_callback );
50
51
}
@@ -69,9 +70,13 @@ static void update_screen(void) {
69
70
"Global Set Point: %d" ,
70
71
global_temperature_setpoint );
71
72
73
+ uint8_t whole_temp = measured_temperature / 100 ;
74
+ uint8_t decimal_temp = measured_temperature % 100 ;
75
+
72
76
sprintf (temperature_current_measure_str ,
73
- "Measured Temp: %d" ,
74
- measured_temperature );
77
+ "Measured Temp: %d.%d" ,
78
+ whole_temp ,
79
+ decimal_temp );
75
80
76
81
// Use u8g2 library to draw each string.
77
82
u8g2_ClearBuffer (& u8g2 );
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ static void update_screen(void);
19
19
20
20
uint8_t global_temperature_setpoint = 0 ;
21
21
uint8_t local_temperature_setpoint = 22 ;
22
- int measured_temperature = 0 ;
22
+ uint8_t measured_temperature = 0 ;
23
23
24
24
uint8_t prior_global_temperature_setpoint = 255 ;
25
25
uint8_t prior_local_temperature_setpoint = 255 ;
You can’t perform that action at this time.
0 commit comments