Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
738765e388 | ||
|
50ccf1b5e7 | ||
|
56c9bf0de0 | ||
|
c976ad2dc6 | ||
|
2e93eae0a4 | ||
|
bf56f0f12b | ||
|
6f5f38d35e | ||
|
5c0be63b8d | ||
|
ea17a6c521 | ||
|
db9488aa8d | ||
|
58ed0d481a | ||
|
cd2552708e | ||
|
4d7e3ee1d3 | ||
|
311e58c97d | ||
|
ab4234c36c | ||
|
dcbed4653c | ||
|
88e1a4b9ec | ||
|
6aa5b8b47a | ||
|
f06bbe238e | ||
|
6c677e31d3 | ||
|
4e845ba553 | ||
|
4bb48bd648 | ||
|
8f29f18fd3 | ||
|
072347ee32 | ||
|
291335a765 | ||
|
9a4e33e6cd | ||
|
5d01111db1 | ||
|
d8436069f2 | ||
|
143b5a1cb3 |
@ -9,7 +9,7 @@
|
||||
#define printIIC(args) Wire.write(args)
|
||||
inline size_t LiquidCrystal_I2C::write(uint8_t value) {
|
||||
send(value, Rs);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -52,6 +52,11 @@ LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t l
|
||||
_backlightval = LCD_NOBACKLIGHT;
|
||||
}
|
||||
|
||||
void LiquidCrystal_I2C::oled_init(){
|
||||
_oled = true;
|
||||
init_priv();
|
||||
}
|
||||
|
||||
void LiquidCrystal_I2C::init(){
|
||||
init_priv();
|
||||
}
|
||||
@ -127,6 +132,7 @@ void LiquidCrystal_I2C::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
|
||||
void LiquidCrystal_I2C::clear(){
|
||||
command(LCD_CLEARDISPLAY);// clear display, set cursor position to zero
|
||||
delayMicroseconds(2000); // this command takes a long time!
|
||||
if (_oled) setCursor(0,0);
|
||||
}
|
||||
|
||||
void LiquidCrystal_I2C::home(){
|
||||
@ -214,6 +220,15 @@ void LiquidCrystal_I2C::createChar(uint8_t location, uint8_t charmap[]) {
|
||||
}
|
||||
}
|
||||
|
||||
//createChar with PROGMEM input
|
||||
void LiquidCrystal_I2C::createChar(uint8_t location, const char *charmap) {
|
||||
location &= 0x7; // we only have 8 locations 0-7
|
||||
command(LCD_SETCGRAMADDR | (location << 3));
|
||||
for (int i=0; i<8; i++) {
|
||||
write(pgm_read_byte_near(charmap++));
|
||||
}
|
||||
}
|
||||
|
||||
// Turn the (optional) backlight off/on
|
||||
void LiquidCrystal_I2C::noBacklight(void) {
|
||||
_backlightval=LCD_NOBACKLIGHT;
|
||||
@ -302,6 +317,8 @@ void LiquidCrystal_I2C::printstr(const char c[]){
|
||||
|
||||
|
||||
// unsupported API functions
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
void LiquidCrystal_I2C::off(){}
|
||||
void LiquidCrystal_I2C::on(){}
|
||||
void LiquidCrystal_I2C::setDelay (int cmdDelay,int charDelay) {}
|
||||
@ -311,5 +328,5 @@ uint8_t LiquidCrystal_I2C::init_bargraph(uint8_t graphtype){return 0;}
|
||||
void LiquidCrystal_I2C::draw_horizontal_graph(uint8_t row, uint8_t column, uint8_t len, uint8_t pixel_col_end){}
|
||||
void LiquidCrystal_I2C::draw_vertical_graph(uint8_t row, uint8_t column, uint8_t len, uint8_t pixel_row_end){}
|
||||
void LiquidCrystal_I2C::setContrast(uint8_t new_val){}
|
||||
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
@ -77,14 +77,18 @@ public:
|
||||
void autoscroll();
|
||||
void noAutoscroll();
|
||||
void createChar(uint8_t, uint8_t[]);
|
||||
void createChar(uint8_t location, const char *charmap);
|
||||
// Example: const char bell[8] PROGMEM = {B00100,B01110,B01110,B01110,B11111,B00000,B00100,B00000};
|
||||
|
||||
void setCursor(uint8_t, uint8_t);
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
virtual size_t write(uint8_t);
|
||||
#else
|
||||
virtual void write(uint8_t);
|
||||
#endif
|
||||
void command(uint8_t);
|
||||
void init();
|
||||
void oled_init();
|
||||
|
||||
////compatibility API function aliases
|
||||
void blink_on(); // alias for blink()
|
||||
@ -118,6 +122,7 @@ private:
|
||||
uint8_t _displaycontrol;
|
||||
uint8_t _displaymode;
|
||||
uint8_t _numlines;
|
||||
bool _oled = false;
|
||||
uint8_t _cols;
|
||||
uint8_t _rows;
|
||||
uint8_t _backlightval;
|
||||
|
Binary file not shown.
@ -1,2 +1,6 @@
|
||||
# LiquidCrystal_I2C
|
||||
LiquidCrystal Arduino library for the DFRobot I2C LCD displays
|
||||
|
||||
LiquidCrystal Arduino library for I2C LCD displays
|
||||
|
||||
**Status: Archived**
|
||||
This repository has been transfered to GitLab at https://gitlab.com/tandembyte/LCD_I2C
|
||||
|
@ -52,7 +52,7 @@ void displayKeyCodes(void) {
|
||||
while (1) {
|
||||
lcd.clear();
|
||||
lcd.print("Codes 0x"); lcd.print(i, HEX);
|
||||
lcd.print("-0x"); lcd.print(i+16, HEX);
|
||||
lcd.print("-0x"); lcd.print(i+15, HEX);
|
||||
lcd.setCursor(0, 1);
|
||||
for (int j=0; j<16; j++) {
|
||||
lcd.printByte(i+j);
|
||||
@ -67,4 +67,4 @@ void loop()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
//YWROBOT
|
||||
//Compatible with the Arduino IDE 1.0
|
||||
//Library version:1.1
|
||||
#include <Wire.h>
|
||||
#include <LiquidCrystal_I2C.h>
|
||||
|
||||
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
|
||||
@ -9,7 +8,6 @@ LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars
|
||||
void setup()
|
||||
{
|
||||
lcd.init(); // initialize the lcd
|
||||
lcd.init();
|
||||
// Print a message to the LCD.
|
||||
lcd.backlight();
|
||||
lcd.setCursor(3,0);
|
||||
|
@ -10,6 +10,7 @@
|
||||
"frameworks": "arduino",
|
||||
"platforms":
|
||||
[
|
||||
"atmelavr"
|
||||
"atmelavr",
|
||||
"espressif8266"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=LiquidCrystal I2C
|
||||
version=1.1.1
|
||||
name=LiquidCrystal_I2C
|
||||
version=1.1.4
|
||||
author=Frank de Brabander
|
||||
maintainer=Marco Schwartz <marcolivier.schwartz@gmail.com>
|
||||
sentence=A library for I2C LCD displays.
|
||||
|
Loading…
x
Reference in New Issue
Block a user