API for the generic LCD Keypad Shield.
More...
The LCD Keypad Shield uses 7 digital outputs and 1 analog input (for the keypad). The outputs are used to drive an attached LCM1602 LCD controller. This driver should be compatible with the similar LCD keypad shields from Sainsmart, DFRobot and Sparkfun.
lcd.
write(
"LCDKS driver");
lcd.
write(
"Hello World");
while (shouldRun) {
upm_delay(1);
}
LCDKS |
( |
int |
rs = 8 , |
|
|
int |
enable = 9 , |
|
|
int |
d0 = 4 , |
|
|
int |
d1 = 5 , |
|
|
int |
d2 = 6 , |
|
|
int |
d3 = 7 , |
|
|
int |
keypad = 0 , |
|
|
int |
backlight = -1 |
|
) |
| |
LCDKS constructor
As this is a shield, you will not likely have any choice over the pins that are used. For this reason, we provide defaults for all of them – of course they can be changed if your device is different.
- Parameters
-
rs | Register select pin. |
enable | Enable pin. |
d0 | Data 0 pin. |
d1 | Data 1 pin. |
d2 | Data 2 pin. |
d3 | Data 3 pin. |
keypad | Analog pin of the keypad. |
backlight | Optional GPIO backlight pin. Specify -1 if not in use or not supported on your device. |
- Exceptions
-
std::runtime_error | on initialization error. |
upm_result_t write |
( |
std::string |
msg | ) |
|
Writes a string to the LCD
- Parameters
-
msg | std::string to write to the display; note: only ASCII characters are supported |
- Returns
- Result of the operation
upm_result_t setCursor |
( |
int |
row, |
|
|
int |
column |
|
) |
| |
Sets the cursor to specified coordinates
- Parameters
-
row | Row to set the cursor to |
column | Column to set the cursor to |
- Returns
- Result of the operation
Clears the display of all characters
- Returns
- Result of the operation
Returns to the original coordinates (0,0)
- Returns
- Result of the operation
upm_result_t createChar |
( |
uint8_t |
charSlot, |
|
|
std::vector< uint8_t > |
charData |
|
) |
| |
Create a custom character
- Parameters
-
charSlot | the character slot to write, only 8 are available |
charData | A vector containing 8 bytes making up the character |
- Returns
- Result of operation
upm_result_t displayOn |
( |
| ) |
|
Turn the display on
- Returns
- Result of operation
upm_result_t displayOff |
( |
| ) |
|
Turn the display off
- Returns
- Result of operation
upm_result_t cursorOn |
( |
| ) |
|
Turn the cursor on
- Returns
- Result of operation
upm_result_t cursorOff |
( |
| ) |
|
Turn the cursor off
- Returns
- Result of operation
upm_result_t cursorBlinkOn |
( |
| ) |
|
Turn cursor blink on
- Returns
- Result of operation
upm_result_t cursorBlinkOff |
( |
| ) |
|
Turn cursor blink off
- Returns
- Result of operation
upm_result_t backlightOn |
( |
| ) |
|
Turn backlight on
- Returns
- Result of operation
upm_result_t backlightOff |
( |
| ) |
|
Turn backlight off
- Returns
- Result of operation
upm_result_t scrollDisplayLeft |
( |
| ) |
|
Scroll the display left, without changing the character RAM
- Returns
- Result of operation
upm_result_t scrollDisplayRight |
( |
| ) |
|
Scroll the display right, without changing the character RAM
- Returns
- Result of operation
upm_result_t entryLeftToRight |
( |
| ) |
|
set the entry mode so that characters are added left to right
- Returns
- Result of operation
upm_result_t entryRightToLeft |
( |
| ) |
|
set the entry mode so that characters are added right to left
- Returns
- Result of operation
upm_result_t autoscrollOn |
( |
| ) |
|
Right justify text entered from the cursor
- Returns
- Result of operation
upm_result_t autoscrollOff |
( |
| ) |
|
Left justify text entered from the cursor
- Returns
- Result of operation
Returns the floating point representation of the key that is being pushed. Each key produces a different value between 0.0 and 1.0, and only one key can be read at a time.
- Returns
- The floating point value representing a key.
Returns the floating point representation of the key that is being pushed. Each key produces a different value between 0.0 and 1.0, and only one key can be read at a time.
- Deprecated:
- This function is deprecated. Use getKeyValue() instead.
- Returns
- The floating point value representing a key.
The documentation for this class was generated from the following files: