Skip to content

Commit

Permalink
Merge pull request #6 from hasenradball/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
hasenradball authored Dec 2, 2023
2 parents 5210d84 + 2ce345e commit 67738eb
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 79 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,25 @@ The communication is realized by a PCF8574 remote 8 bit I/O Expander for I²c Bu


## LCD Documentation
### Hitatchi HD44780
The Hitachi HD44780 LCD controller is an alphanumeric dot matrix liquid crystal display (LCD) controller developed by Hitachi in the 1980s. The character set of the controller includes ASCII characters, Japanese Kana characters, and some symbols in two 40 character lines. Using an extension driver, the device can display up to 80 characters. Numerous third-party displays are compatible with its 16-pin interface and instruction set, making it a popular and cheap LCD driver.

In 8-bit mode, all transfers happen in one cycle of the enable pin (E) with all 8 bits on the data bus and the RS and R/W pins stable. In 4-bit mode, data are transferred as pairs of 4-bit "nibbles" on the upper data pins, D7–D4, with two enable pulses and the RS and R/W pins stable. The four most significant bits (7–4) must be written first, followed by the four least significant bits (3–0). The high/low sequence must be completed each time or the controller will not properly receive further commands.

### Character Generator ROM (CGROM)
The internal CGROM includes 208 characters in a 5x8 dot matrix, and also 32 characters in a 5x10 dot matrix.
The 5x10 matrix is generally not used.

### Character Generator RAM (CGRAM)
Additionally to the CGROM there is a CGRAM, in which 8 user-defined characters in 5x8 dot matrix, or 4 characters in a 5x10 dot matrix can be stored.
This enables to store characters which are not available in the CGROM.

## Library Usage

# License
This library is licensed under MIT Licence.

[LCD-I2C licence](https://github.com/hasenradball/LCD-I2C/blob/master/LICENSE)

# Helpful Links
[Wikipedia - a great description of HD44780 module](https://de.wikipedia.org/wiki/HD44780)
Expand Down
1 change: 1 addition & 0 deletions examples/Custom_Chars/Custom_Chars.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ uint8_t snow[8] =
void setup()
{
lcd.begin();
lcd.display();
lcd.backlight();

lcd.createChar(0, happy);
Expand Down
10 changes: 5 additions & 5 deletions examples/Functions/Functions.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ LCD_I2C lcd(0x27, 16, 2);
* More info: https://www.arduino.cc/reference/en/language/variables/utilities/progmem/
*/

void setup()
{
void setup() {
lcd.begin();
lcd.display();
lcd.backlight();
}

Expand All @@ -41,7 +41,7 @@ void loop()
delay(200);
}

lcd.noAutoscroll();
lcd.autoscrollOff();
lcd.clear();

// Scroll left and right
Expand Down Expand Up @@ -77,9 +77,9 @@ void loop()

//Blink without cursor
lcd.setCursor(0, 0);
lcd.noCursor();
lcd.cursorOff();
lcd.print(F("Just blink"));
delay(3000);
lcd.noBlink();
lcd.blinkOff();
lcd.clear();
}
11 changes: 6 additions & 5 deletions examples/Hello_World/Hello_World.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

LCD_I2C lcd(0x27, 16, 2); // Default address of most PCF8574 modules, change according

void setup()
{
lcd.begin(); // If you are using more I2C devices using the Wire library use lcd.begin(false)
// this stop the library(LCD-I2C) from calling Wire.begin()
void setup() {
// If you are using more I2C devices using the Wire library use lcd.begin(false)
// this stop the library(LCD-I2C) from calling Wire.begin()
lcd.begin();
lcd.display();
lcd.backlight();
}

Expand All @@ -31,7 +32,7 @@ void loop()
{
lcd.backlight();
delay(50);
lcd.noBacklight();
lcd.backlightOff();
delay(50);
}

Expand Down
28 changes: 14 additions & 14 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ LCD_I2C KEYWORD1
##################################
begin KEYWORD2
backlight KEYWORD2
noBacklight KEYWORD2
backlightOff KEYWORD2
clear KEYWORD2
home KEYWORD2
leftToRight KEYWORD2
rightToLeft KEYWORD2
autoscroll KEYWORD2
noAutoscroll KEYWORD2
autoscrollOff KEYWORD2
display KEYWORD2
noDisplay KEYWORD2
displayOff KEYWORD2
cursor KEYWORD2
noCursor KEYWORD2
cursorOff KEYWORD2
blink KEYWORD2
noBlink KEYWORD2
blinkOff KEYWORD2
scrollDisplayLeft KEYWORD2
scrollDisplayRight KEYWORD2
createChar KEYWORD2
Expand All @@ -38,12 +38,12 @@ setCursor KEYWORD2
##################################
# Constants (LITERAL1)
##################################
LCD_CLEAR LITERAL1
LCD_CLEAR LITERAL1
LCD_HOME LITERAL1
LCD_ENTRY_MODE_SET LITERAL1
LCD_DISPLAY_CONTROL LITERAL1
LCD_CURSOR_OR_DISPLAY_SHIFT LITERAL1
LCD_FUNCTION_SET LITERAL1
LCD_SET_CGRAM_ADDR LITERAL1
LCD_SET_DDRRAM_ADDR LITERAL1
HD44780_CLEAR LITERAL1
HD44780_CLEAR LITERAL1
HD44780_HOME LITERAL1
HD44780_ENTRY_MODE_SET LITERAL1
HD44780_DISPLAY_CONTROL LITERAL1
HD44780_CURSOR_OR_DISPLAY_SHIFT LITERAL1
HD44780_FUNCTION_SET LITERAL1
HD44780_SET_CGRAM_ADDR LITERAL1
HD44780_SET_DDRRAM_ADDR LITERAL1
Loading

0 comments on commit 67738eb

Please sign in to comment.