|
@ -11,7 +11,19 @@ |
|
|
#define LCD_CLASS LiquidCrystalRus |
|
|
#define LCD_CLASS LiquidCrystalRus |
|
|
#else |
|
|
#else |
|
|
#ifdef LCD_I2C |
|
|
#ifdef LCD_I2C |
|
|
|
|
|
#if LCD_I2C_TYPE = 0 |
|
|
|
|
|
#define LCD_I2C_PIN_BL 3 |
|
|
|
|
|
#define LCD_I2C_PIN_EN 2 |
|
|
|
|
|
#define LCD_I2C_PIN_RW 1 |
|
|
|
|
|
#define LCD_I2C_PIN_RS 0 |
|
|
|
|
|
#define LCD_I2C_PIN_D4 4 |
|
|
|
|
|
#define LCD_I2C_PIN_D5 5 |
|
|
|
|
|
#define LCD_I2C_PIN_D6 6 |
|
|
|
|
|
#define LCD_I2C_PIN_D7 7 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#include <Wire.h> |
|
|
#include <Wire.h> |
|
|
|
|
|
#include <LCD.h> |
|
|
#include <LiquidCrystal_I2C.h> |
|
|
#include <LiquidCrystal_I2C.h> |
|
|
#define LCD_CLASS LiquidCrystal_I2C |
|
|
#define LCD_CLASS LiquidCrystal_I2C |
|
|
#else |
|
|
#else |
|
@ -32,7 +44,7 @@ |
|
|
#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */ |
|
|
#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */ |
|
|
|
|
|
|
|
|
#ifdef LCD_I2C |
|
|
#ifdef LCD_I2C |
|
|
LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT, LCD_I2C_TYPE); //address, columns, rows, type
|
|
|
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); |
|
|
#else |
|
|
#else |
|
|
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
|
|
|
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
|
|
|
#endif |
|
|
#endif |
|
@ -122,11 +134,15 @@ static void lcd_implementation_init() |
|
|
B00000, |
|
|
B00000, |
|
|
B00000 |
|
|
B00000 |
|
|
}; //thanks Sonny Mounicou
|
|
|
}; //thanks Sonny Mounicou
|
|
|
|
|
|
|
|
|
#ifdef LCD_I2C |
|
|
#ifdef LCD_I2C |
|
|
lcd.init(); |
|
|
#ifdef LCD_I2C_PIN_BL |
|
|
#else |
|
|
lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE); |
|
|
lcd.begin(LCD_WIDTH, LCD_HEIGHT); |
|
|
lcd.setBacklight(HIGH); |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
lcd.begin(LCD_WIDTH, LCD_HEIGHT); |
|
|
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp); |
|
|
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp); |
|
|
lcd.createChar(LCD_STR_DEGREE[0], degree); |
|
|
lcd.createChar(LCD_STR_DEGREE[0], degree); |
|
|
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer); |
|
|
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer); |
|
|