|
@@ -7,11 +7,16 @@
|
7
|
7
|
**/
|
8
|
8
|
|
9
|
9
|
#if LANGUAGE_CHOICE == 6
|
10
|
|
-#include "LiquidCrystalRus.h"
|
11
|
|
-#define LCD_CLASS LiquidCrystalRus
|
|
10
|
+ #include "LiquidCrystalRus.h"
|
|
11
|
+ #define LCD_CLASS LiquidCrystalRus
|
12
|
12
|
#else
|
13
|
|
-#include <LiquidCrystal.h>
|
14
|
|
-#define LCD_CLASS LiquidCrystal
|
|
13
|
+ #ifdef LCD_I2C
|
|
14
|
+ #include <LiquidCrystal_I2C.h>
|
|
15
|
+ #define LCD_CLASS LiquidCrystal_I2C
|
|
16
|
+ #else
|
|
17
|
+ #include <LiquidCrystal.h>
|
|
18
|
+ #define LCD_CLASS LiquidCrystal
|
|
19
|
+ #endif
|
15
|
20
|
#endif
|
16
|
21
|
|
17
|
22
|
/* Custom characters defined in the first 8 characters of the LCD */
|
|
@@ -25,7 +30,12 @@
|
25
|
30
|
#define LCD_STR_CLOCK "\x07"
|
26
|
31
|
#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */
|
27
|
32
|
|
28
|
|
-LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
|
|
33
|
+#ifdef LCD_I2C
|
|
34
|
+ LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT, LCD_I2C_TYPE); //address, columns, rows, type
|
|
35
|
+#else
|
|
36
|
+ LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
|
|
37
|
+#endif
|
|
38
|
+
|
29
|
39
|
static void lcd_implementation_init()
|
30
|
40
|
{
|
31
|
41
|
byte bedTemp[8] =
|
|
@@ -111,7 +121,11 @@ static void lcd_implementation_init()
|
111
|
121
|
B00000,
|
112
|
122
|
B00000
|
113
|
123
|
}; //thanks Sonny Mounicou
|
114
|
|
- lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
|
124
|
+ #ifdef LCD_I2C
|
|
125
|
+ lcd.init();
|
|
126
|
+ #else
|
|
127
|
+ lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
|
128
|
+ #endif
|
115
|
129
|
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
|
116
|
130
|
lcd.createChar(LCD_STR_DEGREE[0], degree);
|
117
|
131
|
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
|