LiquidCrystal
LiquidCrystal_I2C.h
1 #ifndef LIQUID_CRYSTAL_I2C_h
2 #define LIQUID_CRYSTAL_I2C_h
3 
4 #if (ARDUINO < 10000)
5 #include <../Wire/Wire.h>
6 #else
7 #include <Wire.h>
8 #endif
9 #include "LiquidCrystal_Base.h"
10 
11 // flags for backlight control
12 #define LCD_BACKLIGHT 0x08 //0b00001000
13 #define LCD_NOBACKLIGHT 0x00
14 
15 #define En 0b00000100 // Enable bit B00000100
16 #define Rw 0b00000010 // Read/Write bit B00000010
17 #define Rs 0b00000001 // Register select bit #define Rs B00000001
18 
19 #define LCD_DEFAULT_ADDR 0x27 // Default I2C address
20 
21 
23 public:
24  LiquidCrystal_I2C()=default;
25  LiquidCrystal_I2C(uint8_t lcd_addr, uint8_t lcd_cols, uint8_t lcd_rows, uint8_t charsize = LCD_5x8DOTS);
26 
28 
29  virtual void init(uint8_t mode = LCD_4BITMODE);
30  virtual void init(uint8_t lcd_addr, uint8_t lcd_cols, uint8_t lcd_rows, uint8_t charsize = LCD_5x8DOTS);
31  virtual void begin();
32  virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS, uint8_t mode = LCD_4BITMODE);
33 
34  void setCursor(uint8_t col, uint8_t row);
35  void noBacklight();
36  void backlight();
37  bool getBacklight();
38 
39  // Compatibility API function aliases
40  void setBacklight(uint8_t new_val); // alias for backlight() and nobacklight()
41  void load_custom_character(uint8_t char_num, uint8_t *rows); // alias for createChar()
42  void printstr(const char[]);
43 
44  virtual void write4bits(uint8_t value);
45 
46 private:
47  void send(uint8_t value, uint8_t mode);
48  void expanderWrite(uint8_t _data);
49  void pulseEnable(uint8_t _data);
50  uint8_t _addr = LCD_DEFAULT_ADDR;
51  uint8_t _backlightval = LCD_NOBACKLIGHT;
52 };
53 
54 #endif
Definition: LiquidCrystal_I2C.h:22
Definition: LiquidCrystal_Base.h:27