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.

SSD1306 Class

Module: lcd

SSD1306 is a 128x64 dot-matrix OLED/PLED segment driver with a controller. This device is available from many suppliers for a very low cost. This implementation was tested using a generic SSD1306 device from eBay.
ssd1306.jpeg

Methods

SSD1306

(
  • bus
  • address
)
Number

SSD1306 constructor; calls libmraa initialisation functions

Parameters:

  • bus Number

    I2C bus to use

  • address Number

    Slave address the LCD is registered on

Returns:

Number:

draw

(
  • data
  • bytes
)
Mraa::Result

Draws an image; see examples/python/make_oled_pic.py for an explanation of how pixels are mapped to bytes

Parameters:

  • data Uint8_t *

    Buffer to read

  • bytes Number

    Number of bytes to read from the pointer

Returns:

Mraa::Result:

Result of the operation

write

(
  • msg
)
Mraa::Result

Writes a string to the LCD

Parameters:

  • msg String

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

Returns:

Mraa::Result:

Result of the operation

setCursor

(
  • row
  • column
)
Mraa::Result

Sets the cursor to specified coordinates

Parameters:

  • row Number

    Row to set the cursor to

  • column Number

    Column to set the cursor to

Returns:

Mraa::Result:

Result of the operation

clear

() Mraa::Result

Clears the display of all characters

Returns:

Mraa::Result:

Result of the operation

home

() Mraa::Result

Returns to the original coordinates (0,0)

Returns:

Mraa::Result:

Result of the operation

invert

(
  • i
)
Mraa::Result

Inverts the display

Parameters:

  • i Boolean

    true to invert, false for normal display

Returns:

Mraa::Result:

Result of the operation

startscrollright

(
  • start
  • stop
)

Activate a scroll to the right for rows start through stop The display is 16 rows tall. To scroll the whole display, run: display.scrollright(0x00, 0x0F)

Parameters:

  • start Number

    First row to scroll

  • stop Number

    Last row to scroll

startscrollleft

(
  • start
  • stop
)

Activate a scroll to the left for rows start through stop The display is 16 rows tall. To scroll the whole display, run: display.startscrollright(0x00, 0x0F)

Parameters:

  • start Number

    First row to scroll

  • stop Number

    Last row to scroll

startscrolldiagright

(
  • start
  • stop
)

Activate a scroll to the upper right for rows start through stop The display is 16 rows tall. To scroll the whole display, run: display.startscrollleft(0x00, 0x0F)

Parameters:

  • start Number

    First row to scroll

  • stop Number

    Last row to scroll

startscrolldiagleft

(
  • start
  • stop
)

Activate a scroll to the upper left for rows start through stop The display is 16 rows tall. To scroll the whole display, run: display.startscrolldiaagright(0x00, 0x0F)

Parameters:

  • start Number

    First row to scroll

  • stop Number

    Last row to scroll

stopscroll

()

Stops display scrolling.

dim

(
  • dim
)

Dims display

Parameters:

  • dim Boolean

    True to dim display, false for max intensity