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.

EBOLED Class

Module: lcd

The EBOLED is an ssd1306 with some modifications to work as an Edison Block. It is a 64x48 pixel OLED display that connects directly to an edison via it's 80-pin connector. Edison Blocks are stackable modules created by Sparkfun.
This block has some buttons on it that can be accessed using standard GPIO b this driver only concerns itself with the display.
eboled.jpg

Methods

EBOLED

(
  • spi
  • CD
  • reset
)
Number

EBOLED Constructor. Note that you will not have any choice as to the pins used, so they are all set to default values.

Parameters:

  • spi Number

    spi bus to use

  • CD Number

    Command/Data select pin

  • reset Number

    reset pin

Returns:

Number:

refresh

() Mraa::Result

Draw the buffer to screen.

Returns:

Mraa::Result:

result of operation

write

(
  • msg
)
Mraa::Result

Write a string to LCD

Parameters:

  • msg String

    the std::string to write to display, note only ascii chars are supported

Returns:

Mraa::Result:

result of operation

setCursor

(
  • row
  • column
)
Mraa::Result

Set cursor to a coordinate

Parameters:

  • row Number

    Axis on the vertical scale. This device supports 6 rows.

  • column Number

    Axis on the horizontal scale This device supports 64 columns

Returns:

Mraa::Result:

result of operation

setTextColor

(
  • textColor
)

Sets a text color for a message

Parameters:

  • textColor Number

    Font color: COLOR_WHITE, COLOR_BLACK or COLOR_XOR

setTextSize

(
  • size
)

Sets the size of the font

Parameters:

  • size Number

    Font size

setTextWrap

(
  • wrap
)

Wraps a printed message

Parameters:

  • wrap Number

    True (1) or false (0)

drawChar

(
  • x
  • y
  • data
  • color
  • size
)

Write a single character to the screen.

Parameters:

  • x Number

    Axis on the horizontal scale

  • y Number

    Axis on the vertical scale

  • data Number

    Character to write

  • color Number

    Character color

  • size Number

    Size of the font

clear

() Mraa::Result

Clear display

Returns:

Mraa::Result:

result of operation

clearScreenBuffer

()

home

() Mraa::Result

Return to coordinate 0,0

Returns:

Mraa::Result:

result of operation

drawPixel

(
  • x
  • y
  • color
)

Write a single pixel to the screen buffer. Can do an specific color write or toggle (xor) a pixel.

Parameters:

  • x Number

    the x position of the pixel

  • y Number

    the y position of the pixel

  • color Number

    pixel is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawLine

(
  • x0
  • y0
  • x1
  • y1
  • color
)

Draw a line to the screen buffer.

Parameters:

  • x0 Number

    the x position of the beginning of the line

  • y0 Number

    the y position of the beginning of the line

  • x1 Number

    the x position of the end of the line

  • y1 Number

    the y position of the end of the line

  • color Number

    line is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawLineHorizontal

(
  • x
  • y
  • width
  • color
)

Draw a horizontal line to the screen buffer.

Parameters:

  • x Number

    the x position of the beginning of the line

  • y Number

    the y position of the beginning of the line

  • width Number

    is the horizontal length of the line

  • color Number

    line is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawLineVertical

(
  • x
  • y
  • height
  • color
)

Draw a vertical line to the screen buffer.

Parameters:

  • x Number

    the x position of the beginning of the line

  • y Number

    the y position of the beginning of the line

  • height Number

    is the vertical length of the line

  • color Number

    line is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRectangle

(
  • x
  • y
  • width
  • height
  • color
)

Draw a rectangle to the screen buffer.

Parameters:

  • x Number

    the left edge

  • y Number

    the top edge

  • width Number

    sets the right edge

  • height Number

    bottom edge

  • color Number

    outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRoundedRectangle

(
  • x
  • y
  • width
  • height
  • radius
  • color
)

Draw a rectangle with rounded corners to the screen buffer.

Parameters:

  • x Number

    the left edge

  • y Number

    the top edge

  • width Number

    sets the right edge

  • height Number

    bottom edge

  • radius Number

    of the rounded corners

  • color Number

    outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRectangleFilled

(
  • x
  • y
  • width
  • height
  • color
)

Draw a filled rectangle to the screen buffer.

Parameters:

  • x Number

    the left edge

  • y Number

    the top edge

  • width Number

    sets the right edge

  • height Number

    bottom edge

  • color Number

    fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawTriangle

(
  • x0
  • y0
  • x1
  • y1
  • x2
  • y2
  • color
)

Draw a triangle to the screen buffer.

Parameters:

  • x0 Number

    the x coordinate of the first corner

  • y0 Number

    the y coordinate of the first corner

  • x1 Number

    the x coordinate of the second corner

  • y1 Number

    the y coordinate of the second corner

  • x2 Number

    the x coordinate of the third corner

  • y2 Number

    the y coordinate of the third corner

  • color Number

    outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawTriangleFilled

(
  • x0
  • y0
  • x1
  • y1
  • x2
  • y2
  • color
)

Draw a filled triangle to the screen buffer.

Parameters:

  • x0 Number

    the x coordinate of the first corner

  • y0 Number

    the y coordinate of the first corner

  • x1 Number

    the x coordinate of the second corner

  • y1 Number

    the y coordinate of the second corner

  • x2 Number

    the x coordinate of the third corner

  • y2 Number

    the y coordinate of the third corner

  • color Number

    fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawCircle

(
  • x0
  • y0
  • radius
  • color
)

Draw a circle to the screen buffer.

Parameters:

  • x0 Number

    the x coordinate of the circle's center

  • y0 Number

    the y coordinate of the circle's center

  • radius Number

    the radius of the circle

  • color Number

    outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRoundCorners

(
  • x0
  • y0
  • radius
  • cornername
  • color
)

Draw a quarter circle arc to the screen buffer.

Parameters:

  • x0 Number

    the x coordinate of the arc's center

  • y0 Number

    the y coordinate of the arc's center

  • radius Number

    the radius of the arc

  • cornername Number

    denotes which of the 4 quarters to draw - 1,2,4,8

  • color Number

    outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawCircleFilled

(
  • x0
  • y0
  • radius
  • color
)

Draw a filled circle to the screen buffer.

Parameters:

  • x0 Number

    the x coordinate of the circle's center

  • y0 Number

    the y coordinate of the circle's center

  • radius Number

    the radius of the circle

  • color Number

    outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRoundedCornersFilled

(
  • x0
  • y0
  • radius
  • cornername
  • delta
  • color
)

Draw a quarter pie to the screen buffer.

Parameters:

  • x0 Number

    the x coordinate of the arc's center

  • y0 Number

    the y coordinate of the arc's center

  • radius Number

    the radius of the arc

  • cornername Number

    denotes which of the 4 quarters to draw - 1,2,4,8

  • delta Number

    undefined

  • color Number

    fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

fillScreen

(
  • color
)

Fill the screen buffer with specified color.

Parameters:

  • color Number

    fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR