UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

LCDKS Class

Module: lcdks

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.
keypadlcd.jpg

Methods

LCDKS

(
  • rs
  • enable
  • d0
  • d1
  • d2
  • d3
  • keypad
  • backlight
)
Number

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 b of course they can be changed if your device is different.

Parameters:

  • rs Number

    Register select pin.

  • enable Number

    Enable pin.

  • d0 Number

    Data 0 pin.

  • d1 Number

    Data 1 pin.

  • d2 Number

    Data 2 pin.

  • d3 Number

    Data 3 pin.

  • keypad Number

    Analog pin of the keypad.

  • backlight Number

    Optional GPIO backlight pin. Specify -1 if not in use or not supported on your device.

Returns:

Number:

write

(
  • msg
)
Upm_result_t

Writes a string to the LCD

Parameters:

  • msg String

    std::string to write to the display; note: only ASCII characters are supported

Returns:

Upm_result_t:

Result of the operation

setCursor

(
  • row
  • column
)
Upm_result_t

Sets the cursor to specified coordinates

Parameters:

  • row Number

    Row to set the cursor to

  • column Number

    Column to set the cursor to

Returns:

Upm_result_t:

Result of the operation

clear

() Upm_result_t

Clears the display of all characters

Returns:

Upm_result_t:

Result of the operation

home

() Upm_result_t

Returns to the original coordinates (0,0)

Returns:

Upm_result_t:

Result of the operation

createChar

(
  • charSlot
  • charData
)
Upm_result_t

Create a custom character

Parameters:

  • charSlot Number

    the character slot to write, only 8 are available

  • charData Std::vector uint8_t

    A vector containing 8 bytes making up the character

Returns:

Upm_result_t:

Result of operation

displayOn

() Upm_result_t

Turn the display on

Returns:

Upm_result_t:

Result of operation

displayOff

() Upm_result_t

Turn the display off

Returns:

Upm_result_t:

Result of operation

cursorOn

() Upm_result_t

Turn the cursor on

Returns:

Upm_result_t:

Result of operation

cursorOff

() Upm_result_t

Turn the cursor off

Returns:

Upm_result_t:

Result of operation

cursorBlinkOn

() Upm_result_t

Turn cursor blink on

Returns:

Upm_result_t:

Result of operation

cursorBlinkOff

() Upm_result_t

Turn cursor blink off

Returns:

Upm_result_t:

Result of operation

backlightOn

() Upm_result_t

Turn backlight on

Returns:

Upm_result_t:

Result of operation

backlightOff

() Upm_result_t

Turn backlight off

Returns:

Upm_result_t:

Result of operation

scrollDisplayLeft

() Upm_result_t

Scroll the display left, without changing the character RAM

Returns:

Upm_result_t:

Result of operation

scrollDisplayRight

() Upm_result_t

Scroll the display right, without changing the character RAM

Returns:

Upm_result_t:

Result of operation

entryLeftToRight

() Upm_result_t

set the entry mode so that characters are added left to right

Returns:

Upm_result_t:

Result of operation

entryRightToLeft

() Upm_result_t

set the entry mode so that characters are added right to left

Returns:

Upm_result_t:

Result of operation

autoscrollOn

() Upm_result_t

Right justify text entered from the cursor

Returns:

Upm_result_t:

Result of operation

autoscrollOff

() Upm_result_t

Left justify text entered from the cursor

Returns:

Upm_result_t:

Result of operation

getKeyValue

() Number

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:

Number:

The floating point value representing a key.

getRawKeyValue

() Number

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:

Number:

The floating point value representing a key.