public class HD44780Lcd extends Object implements Closeable
LCD with HD44780 controller.
Code based on
this Raspberry-Pi Spy article, Python code.
Another source of information: https://gist.github.com/DenisFromHR/cc863375a6e19dce359d.
Modifier and Type | Class and Description |
---|---|
static class |
HD44780Lcd.Characters |
static interface |
HD44780Lcd.LcdConnection |
static class |
HD44780Lcd.PCF8574LcdConnection |
static class |
HD44780Lcd.PiFaceCadLcdConnection |
Constructor and Description |
---|
HD44780Lcd(HD44780Lcd.LcdConnection lcdConnection,
int columns,
int rows) |
Modifier and Type | Method and Description |
---|---|
HD44780Lcd |
addText(char character) |
HD44780Lcd |
addText(int code) |
HD44780Lcd |
addText(String text) |
HD44780Lcd |
autoscrollOff() |
HD44780Lcd |
autoscrollOn() |
HD44780Lcd |
blinkOff() |
HD44780Lcd |
blinkOn() |
HD44780Lcd |
clear()
Clear the display
|
void |
close() |
HD44780Lcd |
createChar(int location,
byte[] charMap) |
HD44780Lcd |
cursorOff() |
HD44780Lcd |
cursorOn() |
HD44780Lcd |
cursorOrDisplayShift(boolean displayShift,
boolean shiftRight)
Cursor or display shift shifts the cursor position or display to the right
or left without writing or reading display data.
|
HD44780Lcd |
displayControl(boolean displayOn,
boolean cursorEnabled,
boolean blinkEnabled) |
HD44780Lcd |
displayOff() |
HD44780Lcd |
displayOn() |
HD44780Lcd |
entryModeControl(boolean increment,
boolean shiftDisplay)
Control text entry mode.
|
int |
getColumnCount() |
int |
getRowCount() |
boolean |
isBacklightEnabled() |
boolean |
isBlinkEnabled() |
boolean |
isCursorEnabled() |
boolean |
isIncrementOn() |
boolean |
isShiftDisplayOn() |
HD44780Lcd |
moveCursorLeft() |
HD44780Lcd |
moveCursorRight() |
HD44780Lcd |
returnHome()
Return the cursor to the home position
|
HD44780Lcd |
setBacklightEnabled(boolean backlightEnabled) |
HD44780Lcd |
setCharacter(int column,
int row,
char character) |
HD44780Lcd |
setCursorPosition(int column,
int row) |
HD44780Lcd |
setText(int row,
String text)
Send string to display
|
HD44780Lcd |
shiftDisplayLeft() |
HD44780Lcd |
shiftDisplayRight() |
public HD44780Lcd(HD44780Lcd.LcdConnection lcdConnection, int columns, int rows)
public int getColumnCount()
public int getRowCount()
public boolean isBacklightEnabled()
public HD44780Lcd setBacklightEnabled(boolean backlightEnabled)
public HD44780Lcd setCursorPosition(int column, int row)
public HD44780Lcd setCharacter(int column, int row, char character)
public HD44780Lcd setText(int row, String text)
row
- Row number (starts at 0)text
- Text to displaypublic HD44780Lcd addText(String text)
public HD44780Lcd addText(char character)
public HD44780Lcd addText(int code)
public HD44780Lcd clear()
public HD44780Lcd returnHome()
public HD44780Lcd entryModeControl(boolean increment, boolean shiftDisplay)
increment
- The cursor or blinking moves to the right when incremented
by 1 and to the left when decremented by 1.shiftDisplay
- Shifts the entire display either to the right (I/D = 0) or
to the left (I/D = 1) when true. The display does not shift
if false. If true, it will seem as if the cursor does not
move but the display does.public HD44780Lcd autoscrollOn()
public HD44780Lcd autoscrollOff()
public boolean isIncrementOn()
public boolean isShiftDisplayOn()
public HD44780Lcd displayControl(boolean displayOn, boolean cursorEnabled, boolean blinkEnabled)
public HD44780Lcd displayOn()
public HD44780Lcd displayOff()
public HD44780Lcd cursorOn()
public HD44780Lcd cursorOff()
public HD44780Lcd blinkOn()
public HD44780Lcd blinkOff()
public boolean isCursorEnabled()
public boolean isBlinkEnabled()
public HD44780Lcd cursorOrDisplayShift(boolean displayShift, boolean shiftRight)
displayShift
- Shift the display if true, the cursor if false.shiftRight
- Shift to the right if true, to the left if false.public HD44780Lcd shiftDisplayRight()
public HD44780Lcd shiftDisplayLeft()
public HD44780Lcd moveCursorRight()
public HD44780Lcd moveCursorLeft()
public HD44780Lcd createChar(int location, byte[] charMap)
public void close() throws RuntimeIOException
close
in interface Closeable
close
in interface AutoCloseable
RuntimeIOException
Copyright © 2016–2018 mattjlewis. All rights reserved.