Lcm1602 Class
- ID: lcm1602
- Name: LCD Display Driver for the LCM1602 Controller for HD44780-based Displays
- Category: display
- Manufacturer: adafruit sparkfun seeed
- Link: https://www.adafruit.com/datasheets/TC1602A-01T.pdf
- Connection: i2c gpio
This supports all sizes of HD44780 displays, from 16x2 to 4x20. The controller has no idea of the actual display hardware, so it lets you write farther than you can see. These displays with such controllers are available from various manufacturers with different I2C addresses. Adafruit* TC1602A-01T seems to be a well-documented example. The driver also supports parallel GPIO connections directly to the HD44780 in case you are not using an I2C expander/backpack.
Example for LCM1602 displays that use the I2C bus Code sample for GPIO based LCM1602 displays
Item Index
Methods
Lcm1602
-
bus
-
address
-
isExpander
-
numColumns
-
numRows
Lcm1602 constructor; calls libmraa initialisation functions
Parameters:
-
bus
NumberI2C bus to use. Default 0 (autodetect).
-
address
NumberSlave address the LCD is registered on. Default 0x27
-
isExpander
BooleanTrue if we are dealing with an I2C expander, false otherwise. Default is true.
-
numColumns
NumberNumber of columns the display has. Default 16.
-
numRows
NumberNumber of rows the display has. Default 2.
Returns:
Lcm1602
-
rs
-
enable
-
d0
-
d1
-
d2
-
d3
-
numColumns
-
numRows
Lcm1602 alternate constructor, used for GPIO based HD44780 controllers supporting RS, Enable, and 4 data pins in 4-bit mode.
Parameters:
-
rs
NumberRegister select pin
-
enable
NumberEnable pin
-
d0
NumberData 0 pin
-
d1
NumberData 1 pin
-
d2
NumberData 2 pin
-
d3
NumberData 3 pin
-
numColumns
NumberNumber of columns the display has. Default 16.
-
numRows
NumberNumber of rows the display has. Default 2.
Returns:
write
-
msg
Writes a string to the LCD
Parameters:
-
msg
Stringstd::string to write to the display; note: only ASCII characters are supported
Returns:
Result of the operation
setCursor
-
row
-
column
Sets the cursor to specified coordinates
Parameters:
-
row
NumberRow to set the cursor to
-
column
NumberColumn to set the cursor to
Returns:
Result of the operation
clear
()
Upm_result_t
Clears the display of all characters
Returns:
Result of the operation
home
()
Upm_result_t
Returns to the original coordinates (0,0)
Returns:
Result of the operation
createChar
-
charSlot
-
charData
Create a custom character
Parameters:
-
charSlot
Numberthe character slot to write, only 8 are available
-
charData
Std::vector uint8_tA vector containing 8 bytes making up the character
Returns:
Result of operation
displayOn
()
Upm_result_t
Turn the display on
Returns:
Result of operation
displayOff
()
Upm_result_t
Turn the display off
Returns:
Result of operation
cursorOn
()
Upm_result_t
Turn the cursor on
Returns:
Result of operation
cursorOff
()
Upm_result_t
Turn the cursor off
Returns:
Result of operation
cursorBlinkOn
()
Upm_result_t
Turn cursor blink on
Returns:
Result of operation
cursorBlinkOff
()
Upm_result_t
Turn cursor blink off
Returns:
Result of operation
backlightOn
()
Upm_result_t
Turn backlight on
Returns:
Result of operation
backlightOff
()
Upm_result_t
Turn backlight off
Returns:
Result of operation
scrollDisplayLeft
()
Upm_result_t
Scroll the display left, without changing the character RAM
Returns:
Result of operation
scrollDisplayRight
()
Upm_result_t
Scroll the display right, without changing the character RAM
Returns:
Result of operation
entryLeftToRight
()
Upm_result_t
set the entry mode so that characters are added left to right
Returns:
Result of operation
entryRightToLeft
()
Upm_result_t
set the entry mode so that characters are added right to left
Returns:
Result of operation
autoscrollOn
()
Upm_result_t
Right justify text entered from the cursor
Returns:
Result of operation
autoscrollOff
()
Upm_result_t
Left justify text entered from the cursor
Returns:
Result of operation