This Arduino library provides an easy-to-use interface for controlling an HD44780U (or similar) LCD display with a SN74HC595 (or similar) shift register. It can control the display with only four pins from the Arduino.
Installation can be done either from the Arduino IDE or from the source code.
Clone the repository to your projects directory.
cd <directoryOfProject>
git clone https://github.com/eb1992/ShiftLcd
Import the library via relative path instead:
#include "ShiftLcd/src/ShiftLcd.h"
## Usage
1. Include the `ShiftLcd` library in your Arduino sketch and create an instance of it:
```cpp
#include <ShiftLcd.h>
int LCD_EN = 2;
int LCD_D7 = 3;
int SHIFT_SER = 4;
int SHIFT_SRCLK = 5;
ShiftLcd lcd(LCD_EN, LCD_D7, SHIFT_SER, SHIFT_SRCLK);
void setup() {
lcd.begin();
lcd.write("Hello, World!");
}
void loop() {
lcd.scrollLeft();
}
Constructor. Initializes the LCD with specified pin numbers:
ShiftLcd(int LCD_EN, int LCD_D7, int SHIFT_SER, int SHIFT_SRCLK);
Initialize the LCD:
void begin();
Turn on the LCD:
void on();
Turn off the LCD:
void off();
Shift the display text one step to the left:
void shiftLeft();
Shift the display text one step to the right:
void shiftRight();
Scroll text to the right:
void scrollRight(unsigned long delay);
Scroll text to the right with the default time:
void scrollRight();
Scroll text to the left:
void scrollLeft(unsigned long delay);
Scroll text to the left with the default time:
void scrollLeft();
Blink the display:
void blink(unsigned long delay);
Blink the display with the default time:
void blink();
Clear the LCD display:
void clear();
Write a character array:
void write(char msg[]);
Write two character arrays to the two rows of the display:
void write(char msg1[], char msg2[]);
Write a character array and an integer to the two rows of the display:
void write(char msg[], int n);
Write an integer:
void write(int n);
Write a String:
void write(String msg);
Write two Strings to the two rows of the display:
void write(String msg1, String msg2);
Write a String and an integer to the two rows of the display:
void write(String msg, int n);