#include <LiquidCrystalIO.h>
Public Types | |
| enum | BackLightPinMode { BACKLIGHT_NORMAL , BACKLIGHT_INVERTED , BACKLIGHT_PWM } |
Public Member Functions | |
| LiquidCrystal () | |
| LiquidCrystal (uint8_t rs, uint8_t rw, uint8_t en, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, LiquidCrystal::BackLightPinMode mode, IoAbstractionRef ioMethod) | |
| LiquidCrystal (uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, BasicIoAbstraction *ioMethod=NULL) | |
| LiquidCrystal (uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, BasicIoAbstraction *ioMethod=NULL) | |
| LiquidCrystal (uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, BasicIoAbstraction *ioMethod=NULL) | |
| LiquidCrystal (uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, BasicIoAbstraction *ioMethod=NULL) | |
| void | init (uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, BasicIoAbstraction *ioMethod) |
| void | setIoAbstraction (IoAbstractionRef ioRef) |
| void | configureBacklightPin (uint8_t backlightPin, BackLightPinMode mode=LiquidCrystal::BACKLIGHT_NORMAL) |
| void | configureAnalogBacklight (AnalogDevice *analogDevice, uint8_t backlightPin) |
| void | setDelayTime (uint8_t command, uint8_t settleTime) |
| void | begin (uint8_t cols, uint8_t rows, uint8_t charsize=LCD_5x8DOTS) |
| void | clear () |
| void | home () |
| void | backlight () |
| void | noBacklight () |
| void | setBacklight (uint8_t state) |
| void | noDisplay () |
| void | display () |
| void | noBlink () |
| void | blink () |
| void | noCursor () |
| void | cursor () |
| void | scrollDisplayLeft () |
| void | scrollDisplayRight () |
| void | leftToRight () |
| void | rightToLeft () |
| void | autoscroll () |
| void | noAutoscroll () |
| void | setRowOffsets (int row1, int row2, int row3, int row4) |
| void | createChar (uint8_t charNo, const uint8_t data[]) |
| void | createCharPgm (uint8_t, const uint8_t[]) |
| void | setCursor (uint8_t x, uint8_t y) |
| size_t | write (uint8_t ch) override |
| void | command (uint8_t) |
LiquidCrystalIO library works with displays that are compatible with the HD44780 driver. It is derived from the Arduino version, but it supports I2C backpacks and many other configurations. In addition it also uses taskmanager to manage any delays needed for the display hardware, thus reducing the overhead.
| LiquidCrystal::LiquidCrystal | ( | ) |
Sets up the library to work with a DfRobot shield connected on regular pins. For this no configuration is needed.
| LiquidCrystal::LiquidCrystal | ( | uint8_t | rs, |
| uint8_t | rw, | ||
| uint8_t | en, | ||
| uint8_t | d0, | ||
| uint8_t | d1, | ||
| uint8_t | d2, | ||
| uint8_t | d3, | ||
| LiquidCrystal::BackLightPinMode | mode, | ||
| IoAbstractionRef | ioMethod ) |
Used by the two helpers that can quickly create an instance of LiquidCrystal for most I2C backpacks. Normally you would use LiquidCrystalI2C_RS_EN or LiquidCrystalI2C_EN_RS instead. An example of using of those helpers is shown below.
At global level (outside of any functions):
LiquidCrystalI2C_RS_EN(variableName, i2cAddr, invertBacklight)
where variableName is the variable name to assign to. For example lcd i2cAddr is the i2c address of the backpack, for example 0x20 invertBacklight true if the backlight function is inverted, otherwise false
Example: variable name lcd, I2C backpack on addr 0x20, with EN-RW-RS arrangement, inverted backlight function:
LiquidCrystalI2C_EN_RS(lcd, 0x20, true)
| rs | the pin on which RS is connected |
| rw | the pin on which RW is connected |
| enable | the pin on which EN is connected |
| d0 | data pin |
| d1 | data pin |
| d2 | data pin |
| d3 | data pin |
| mode | the backlight mode from the BackLightPinMode enum |
| ioMethod | the IO device to use |
| LiquidCrystal::LiquidCrystal | ( | uint8_t | rs, |
| uint8_t | enable, | ||
| uint8_t | d0, | ||
| uint8_t | d1, | ||
| uint8_t | d2, | ||
| uint8_t | d3, | ||
| uint8_t | d4, | ||
| uint8_t | d5, | ||
| uint8_t | d6, | ||
| uint8_t | d7, | ||
| BasicIoAbstraction * | ioMethod = NULL ) |
Sets up liquid crystal in 8 bit mode, optionally providing an IoDevice abstraction
| rs | the pin on which RS is connected |
| enable | the pin on which EN is connected |
| d0 | data pin |
| d1 | data pin |
| d2 | data pin |
| d3 | data pin |
| d4 | data pin |
| d5 | data pin |
| d6 | data pin |
| d7 | data pin |
| ioMethod | optionally an IoAbstractionRef to a different IO device. |
| LiquidCrystal::LiquidCrystal | ( | uint8_t | rs, |
| uint8_t | rw, | ||
| uint8_t | enable, | ||
| uint8_t | d0, | ||
| uint8_t | d1, | ||
| uint8_t | d2, | ||
| uint8_t | d3, | ||
| uint8_t | d4, | ||
| uint8_t | d5, | ||
| uint8_t | d6, | ||
| uint8_t | d7, | ||
| BasicIoAbstraction * | ioMethod = NULL ) |
Sets up liquid crystal in 8 bit mode, optionally providing an IoDevice abstraction
| rs | the pin on which RS is connected |
| rw | the pin on which RW is connected |
| enable | the pin on which EN is connected |
| d0 | data pin |
| d1 | data pin |
| d2 | data pin |
| d3 | data pin |
| d4 | data pin |
| d5 | data pin |
| d6 | data pin |
| d7 | data pin |
| ioMethod | optionally an IoAbstractionRef to a different IO device. |
| LiquidCrystal::LiquidCrystal | ( | uint8_t | rs, |
| uint8_t | rw, | ||
| uint8_t | enable, | ||
| uint8_t | d0, | ||
| uint8_t | d1, | ||
| uint8_t | d2, | ||
| uint8_t | d3, | ||
| BasicIoAbstraction * | ioMethod = NULL ) |
Sets up liquid crystal in 4 bit mode, optionally providing an IoDevice abstraction
| rs | the pin on which RS is connected |
| rw | the pin on which RW is connected |
| enable | the pin on which EN is connected |
| d0 | data pin |
| d4 | data pin |
| d5 | data pin |
| d6 | data pin |
| d7 | data pin |
| ioMethod | optionally an IoAbstractionRef to a different IO device. |
| LiquidCrystal::LiquidCrystal | ( | uint8_t | rs, |
| uint8_t | enable, | ||
| uint8_t | d0, | ||
| uint8_t | d1, | ||
| uint8_t | d2, | ||
| uint8_t | d3, | ||
| BasicIoAbstraction * | ioMethod = NULL ) |
Sets up liquid crystal in 4 bit mode, optionally providing an IoDevice abstraction
| rs | the pin on which RS is connected |
| enable | the pin on which EN is connected |
| d4 | data pin |
| d5 | data pin |
| d6 | data pin |
| d7 | data pin |
| ioMethod | optionally an IoAbstractionRef to a different IO device. |
| void LiquidCrystal::init | ( | uint8_t | fourbitmode, |
| uint8_t | rs, | ||
| uint8_t | rw, | ||
| uint8_t | enable, | ||
| uint8_t | d0, | ||
| uint8_t | d1, | ||
| uint8_t | d2, | ||
| uint8_t | d3, | ||
| uint8_t | d4, | ||
| uint8_t | d5, | ||
| uint8_t | d6, | ||
| uint8_t | d7, | ||
| BasicIoAbstraction * | ioMethod ) |
Internal method not normally called by users of the library directly. Called by all the other constructors to actually do the main initialisation of the LCD
| fourbitmode | if the device is operating in 4 or 8 bit method |
| rs | the pin on which RS is connected |
| rw | the pin on which RW is connected |
| enable | the pin on which EN is connected |
| d0 | data pin |
| d1 | data pin |
| d2 | data pin |
| d3 | data pin |
| d4 | data pin |
| d5 | data pin |
| d6 | data pin |
| d7 | data pin |
| ioMethod | the IoAbstractionRef or nullptr if not set. |
|
inline |
Sets the device that will be used, IE where the LCD pins are connected to.
| ioRef | the reference to an IO device previously created. |
| void LiquidCrystal::configureBacklightPin | ( | uint8_t | backlightPin, |
| BackLightPinMode | mode = LiquidCrystal::BACKLIGHT_NORMAL ) |
Configure a backlight pin that is used to control the backlight using the setBacklight(level) function. Depending on the type of display you have this may be either:
| backlightPin | the pin on which the backlight is connected |
| mode | one of the modes specified above |
| void LiquidCrystal::configureAnalogBacklight | ( | AnalogDevice * | analogDevice, |
| uint8_t | backlightPin ) |
This function gives more control over how the PWM/DAC/AnalogOut based backlight is configured, you can provide an analog device, you can specifically tell the analog device if it is PWM or DAC mode. For many cases the regular configureBacklightPin would work.
| analogDevice | the analog device to use to set the backlight |
| backlightPin | the pin on which the backlight is set. |
| isPinPwm | if the pin on the provided device is a PWM or DAC pin |
|
inline |
Sets the delay for a given command, at this moment, this can only set the settle time of a standard command.
| command | the command to set the delay for, presently only the settle time. |
| settleTime | the new value of the delay in microseconds. |
| void LiquidCrystal::begin | ( | uint8_t | cols, |
| uint8_t | rows, | ||
| uint8_t | charsize = LCD_5x8DOTS ) |
Unlike the regular display where this is option, in this variant you absolutely must call this function before use.
| cols | the number of colums |
| rows | the number of rows |
| charsize | the character size, defaulted to 5x8 |
| void LiquidCrystal::clear | ( | ) |
Clears the display completely using the clear command on the device, warning that this is a very slow call taking at least 2000 micros.
| void LiquidCrystal::home | ( | ) |
Moves the display back to the home position, calling setCursor(0,0) is much faster.
|
inline |
Turn on the backlight
|
inline |
Turn off the backlight
| void LiquidCrystal::setBacklight | ( | uint8_t | state | ) |
set the backlight state depending on how it is configured. If it is set to PWM mode, then this can be a value between 0 and the maximum PWM value.
| state |
| void LiquidCrystal::noDisplay | ( | ) |
Turn the display off
| void LiquidCrystal::display | ( | ) |
Turn the display on
| void LiquidCrystal::noBlink | ( | ) |
Turn off blinking text
| void LiquidCrystal::blink | ( | ) |
Turn on blinking text
| void LiquidCrystal::noCursor | ( | ) |
Turn off the screen cursor
| void LiquidCrystal::cursor | ( | ) |
Turn on the screen cursor
| void LiquidCrystal::setRowOffsets | ( | int | row1, |
| int | row2, | ||
| int | row3, | ||
| int | row4 ) |
Internal method that is not really for direct calling by users that initialises the instance with the right memory locations to write rows into.
| row1 | the first display row memory |
| row2 | the second display row memory |
| row3 | the third display row memory |
| row4 | the fourth display row memory |
| void LiquidCrystal::createChar | ( | uint8_t | charNo, |
| const uint8_t | data[] ) |
Create a 5x8 character from RAM. You can set any character between 0 and 7
| charNo | the character number to use |
| data | the data for the custom character |
| void LiquidCrystal::createCharPgm | ( | uint8_t | location, |
| const uint8_t | charmap[] ) |
Create a 5x8 character from PROGMEM. You can set any character between 0 and 7
| charNo | the character number to use |
| data | the data for the custom character - from PROGMEM |
| void LiquidCrystal::setCursor | ( | uint8_t | x, |
| uint8_t | y ) |
Sets the cursor position at which the next write will take place
| x | the x location to move to |
| y | the y location to move to |
|
inlineoverride |
Write a single character to the display and moves the cursor position
| ch | the character to write |