Browse Source

Added custom sensor character

master
Robin Thoni 4 years ago
parent
commit
5c7e97c1e3
Signed by: Robin THONI <robin@rthoni.com> GPG Key ID: 4E09DEF46B99E61E
1 changed files with 14 additions and 1 deletions
  1. 14
    1
      main.ino

+ 14
- 1
main.ino View File

4
 
4
 
5
 #define HIBERNATE_DELAY 5000
5
 #define HIBERNATE_DELAY 5000
6
 #define TEMP_TRIGGER 10
6
 #define TEMP_TRIGGER 10
7
+#define LCD_CHAR_SENSOR 1
7
 
8
 
8
 #define PIN_BTN_MODE 11
9
 #define PIN_BTN_MODE 11
9
 #define PIN_BTN_MINUS 10
10
 #define PIN_BTN_MINUS 10
16
 #define PIN_LCD_D2 3
17
 #define PIN_LCD_D2 3
17
 #define PIN_LCD_D3 2
18
 #define PIN_LCD_D3 2
18
 
19
 
20
+byte g_sensorChar[8] = {
21
+        B00100,
22
+        B01110,
23
+        B01110,
24
+        B01110,
25
+        B01110,
26
+        B11111,
27
+        B11111,
28
+        B01110,
29
+};
30
+
19
 Button g_btnMode(PIN_BTN_MODE);
31
 Button g_btnMode(PIN_BTN_MODE);
20
 Button g_btnMinus(PIN_BTN_MINUS);
32
 Button g_btnMinus(PIN_BTN_MINUS);
21
 Button g_btnPlus(PIN_BTN_PLUS);
33
 Button g_btnPlus(PIN_BTN_PLUS);
50
     char curTmp[5], setTmp[5], tmp[17];
62
     char curTmp[5], setTmp[5], tmp[17];
51
     dtostrf(boilerLineState.current / 2.0f, 2, 1, curTmp);
63
     dtostrf(boilerLineState.current / 2.0f, 2, 1, curTmp);
52
     dtostrf(boilerLineState.setting / 2.0f, 2, 1, setTmp);
64
     dtostrf(boilerLineState.setting / 2.0f, 2, 1, setTmp);
53
-    int count = snprintf(tmp, sizeof(tmp), "%c: %s [%s]%c%c", prefix, curTmp, setTmp, isModifying ? '<' : ' ', isActive ? 'o' : ' ');
65
+    int count = snprintf(tmp, sizeof(tmp), "%c: %s [%s]%c%c", prefix, curTmp, setTmp, isModifying ? '<' : ' ', isActive ? LCD_CHAR_SENSOR : ' ');
54
     for (; count < 17; ++count)
66
     for (; count < 17; ++count)
55
     {
67
     {
56
         tmp[count] = ' ';
68
         tmp[count] = ' ';
78
     digitalWrite(PIN_LCD_LED, 1);
90
     digitalWrite(PIN_LCD_LED, 1);
79
 
91
 
80
     g_lcd.begin(16, 2);
92
     g_lcd.begin(16, 2);
93
+    g_lcd.createChar(LCD_CHAR_SENSOR, g_sensorChar);
81
     printState(g_boilerState, g_lcd);
94
     printState(g_boilerState, g_lcd);
82
 
95
 
83
     Serial.begin(9600);
96
     Serial.begin(9600);

Loading…
Cancel
Save