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.

Jhd1313m1 Class

Module: jhd1313m1

JHD1313M1 has two I2C addreses: one belongs to a controller, very similar to the upm::Lcm1602 LCD driver, that controls the HD44780-based display, and the other controls only the backlight. This module was tested with the Seeed Grove LCD RGB Backlight v2.0 display that requires 5V to operate.
grovergblcd.jpg

Methods

Jhd1313m1

(
  • bus
  • lcdAddress
  • rgbAddress
)
Number

Jhd1313m1 constructor

Parameters:

  • bus Number

    I2C bus to use

  • lcdAddress Number

    Slave address the LCD is registered on

  • rgbAddress Number

    Slave address the RGB backlight is registered on

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

scroll

(
  • direction
)
Upm_result_t

Makes the LCD scroll text

Parameters:

  • direction Boolean

    True if scrolling to the right, false otherwise

Returns:

Upm_result_t:

Result of the operation

setColor

(
  • r
  • g
  • b
)
Upm_result_t

Sets the color of the backlight Can be used to change the color even when the backlight is off

Parameters:

  • r Number

    0-255 value for red

  • g Number

    0-255 value for green

  • b Number

    0-255 value for blue

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