|
@@ -11,7 +11,19 @@
|
11
|
11
|
#define LCD_CLASS LiquidCrystalRus
|
12
|
12
|
#else
|
13
|
13
|
#ifdef LCD_I2C
|
|
14
|
+ #if LCD_I2C_TYPE = 0
|
|
15
|
+ #define LCD_I2C_PIN_BL 3
|
|
16
|
+ #define LCD_I2C_PIN_EN 2
|
|
17
|
+ #define LCD_I2C_PIN_RW 1
|
|
18
|
+ #define LCD_I2C_PIN_RS 0
|
|
19
|
+ #define LCD_I2C_PIN_D4 4
|
|
20
|
+ #define LCD_I2C_PIN_D5 5
|
|
21
|
+ #define LCD_I2C_PIN_D6 6
|
|
22
|
+ #define LCD_I2C_PIN_D7 7
|
|
23
|
+ #endif
|
|
24
|
+
|
14
|
25
|
#include <Wire.h>
|
|
26
|
+ #include <LCD.h>
|
15
|
27
|
#include <LiquidCrystal_I2C.h>
|
16
|
28
|
#define LCD_CLASS LiquidCrystal_I2C
|
17
|
29
|
#else
|
|
@@ -32,7 +44,7 @@
|
32
|
44
|
#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */
|
33
|
45
|
|
34
|
46
|
#ifdef LCD_I2C
|
35
|
|
- LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT, LCD_I2C_TYPE); //address, columns, rows, type
|
|
47
|
+ LCD_CLASS lcd(LCD_I2C_ADDRESS,LCD_I2C_PIN_EN,LCD_I2C_PIN_RW,LCD_I2C_PIN_RS,LCD_I2C_PIN_D4,LCD_I2C_PIN_D5,LCD_I2C_PIN_D6,LCD_I2C_PIN_D7);
|
36
|
48
|
#else
|
37
|
49
|
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
|
38
|
50
|
#endif
|
|
@@ -122,11 +134,15 @@ static void lcd_implementation_init()
|
122
|
134
|
B00000,
|
123
|
135
|
B00000
|
124
|
136
|
}; //thanks Sonny Mounicou
|
|
137
|
+
|
125
|
138
|
#ifdef LCD_I2C
|
126
|
|
- lcd.init();
|
127
|
|
- #else
|
128
|
|
- lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
|
139
|
+ #ifdef LCD_I2C_PIN_BL
|
|
140
|
+ lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
|
|
141
|
+ lcd.setBacklight(HIGH);
|
|
142
|
+ #endif
|
129
|
143
|
#endif
|
|
144
|
+
|
|
145
|
+ lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
130
|
146
|
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
|
131
|
147
|
lcd.createChar(LCD_STR_DEGREE[0], degree);
|
132
|
148
|
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
|