GrovePi v0.6.1 GrovePi.RGBLCD View Source

Conveniences for controlling a RGB LCD Display. The display should be connected to the I2C-1 port.

Example usage:

iex> {:ok, config} = GrovePi.RGBLCD.initialize()
{:ok, %GrovePi.RGBLCD.Config{display_control: 12, entry_mode: 6, function: 56}}
iex> {:ok, new_config} = GrovePi.RGBLCD.cursor_on(config)
{:ok, %GrovePi.RGBLCD.Config{display_control: 14, entry_mode: 6, function: 56}}
iex> GrovePi.RGBLCD.set_rgb(0, 255, 0)
:ok
iex> GrovePi.RGBLCD.set_text("hello world!")
:ok

Link to this section Summary

Functions

Autoscroll so display moves with cursor

Display does not move with cursor

Clears the LCD Display

Turn off blinking the cursor

Turn on blinking the cursor

Moves cursor to the left. Accepts spaces (integer), defaults to 1

Turn off the underline cursor

Turn on the underline cursor

Moves cursor to the right. Accepts spaces (integer), defaults to 1

Turns display off quickly

Turns display on quickly

Returns a GrovePi.RGBLCD.Config struct with default configuration.

  • 2 Line
  • 8 bit mode
  • 5x8 dots
  • display on
  • cursor off
  • blink off
  • increment after entry (right to left)
  • display shift (autoscroll) off

Sets cursor position to zero

Initializes the LCD Display. Returns tuple with :ok, and %GrovePi.RGBLCD.Config{} with initial configuration

Scroll display left. Accepts spaces (integer) as an argument, defaults to 1

Scroll display right. Accepts spaces (integer) as an argument, defaults to 1

Sets display to white (255 for Red, Green, and Blue)

Sets cursor given row and value. Home position is (0, 0)

Sets the red, green, and blue values for a RGB LCD Display. Accepts an integer from 0 - 255 for each color

Updates the text on a RGB LCD Display. Deletes existing text

Set text flow from left to right

Set text flow from right to left

Write text at cursor. Does not delete existing text

Link to this section Functions

Autoscroll so display moves with cursor

Display does not move with cursor

Clears the LCD Display

Link to this function cursor_left(spaces \\ 1) View Source

Moves cursor to the left. Accepts spaces (integer), defaults to 1.

Turn off the underline cursor

Turn on the underline cursor

Link to this function cursor_right(spaces \\ 1) View Source

Moves cursor to the right. Accepts spaces (integer), defaults to 1.

Turns display off quickly

Turns display on quickly

Returns a GrovePi.RGBLCD.Config struct with default configuration.

  • 2 Line
  • 8 bit mode
  • 5x8 dots
  • display on
  • cursor off
  • blink off
  • increment after entry (right to left)
  • display shift (autoscroll) off

Sets cursor position to zero

Initializes the LCD Display. Returns tuple with :ok, and %GrovePi.RGBLCD.Config{} with initial configuration.

Link to this function scroll_left(spaces \\ 1) View Source

Scroll display left. Accepts spaces (integer) as an argument, defaults to 1.

Link to this function scroll_right(spaces \\ 1) View Source

Scroll display right. Accepts spaces (integer) as an argument, defaults to 1.

Sets display to white (255 for Red, Green, and Blue)

Sets cursor given row and value. Home position is (0, 0).

Link to this function set_rgb(red, green, blue) View Source

Sets the red, green, and blue values for a RGB LCD Display. Accepts an integer from 0 - 255 for each color.

Updates the text on a RGB LCD Display. Deletes existing text.

Link to this function text_left_to_right(config) View Source

Set text flow from left to right

Link to this function text_right_to_left(config) View Source

Set text flow from right to left

Write text at cursor. Does not delete existing text.