pyupm_lcd module

class pyupm_lcd.EBOLED(spi=0, CD=36, reset=48)[source]

Bases: pyupm_lcd.LCD

API for EBOLED spi controlled OLED display.

ID: eboled

Name: SparkFun Block for Intel Edison - OLED

Other Names: ssd1306

Category: display

Manufacturer: sparkfun

Link:https://www.sparkfun.com/products/13035

Connection: spi 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 this driver only concerns itself with the display.

OLED Sensor image provided by SparkFun* underCC BY-NC-SA-3.0.

C++ includes: eboled.hpp

clear()[source]

mraa::Result clear()

Clear display

result of operation

clearScreenBuffer()[source]

void clearScreenBuffer()

drawChar(x, y, data, color, size)[source]

void drawChar(uint8_t x, uint8_t y, uint8_t data, uint8_t color, uint8_t size)

Write a single character to the screen.

x: Axis on the horizontal scale

y: Axis on the vertical scale

data: Character to write

color: Character color

size: Size of the font

drawCircle(*args)[source]

void drawCircle(int16_t x0, int16_t y0, int16_t radius, uint8_t color=COLOR_WHITE)

Draw a circle to the screen buffer.

x0: the x coordinate of the circle’s center

y0: the y coordinate of the circle’s center

radius: the radius of the circle

color: outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawCircleFilled(x0, y0, radius, color)[source]

void drawCircleFilled(int8_t x0, int8_t y0, int16_t radius, uint8_t color)

Draw a filled circle to the screen buffer.

x0: the x coordinate of the circle’s center

y0: the y coordinate of the circle’s center

radius: the radius of the circle

color: outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawLine(*args)[source]

void drawLine(int8_t x0, int8_t y0, int8_t x1, int8_t y1, uint8_t color=COLOR_WHITE)

Draw a line to the screen buffer.

x0: the x position of the beginning of the line

y0: the y position of the beginning of the line

x1: the x position of the end of the line

y1: the y position of the end of the line

color: line is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawLineHorizontal(*args)[source]

void drawLineHorizontal(int8_t x, int8_t y, uint8_t width, uint8_t color=COLOR_WHITE)

Draw a horizontal line to the screen buffer.

x: the x position of the beginning of the line

y: the y position of the beginning of the line

width: is the horizontal length of the line

color: line is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawLineVertical(*args)[source]

void drawLineVertical(int8_t x, int8_t y, uint8_t height, uint8_t color=COLOR_WHITE)

Draw a vertical line to the screen buffer.

x: the x position of the beginning of the line

y: the y position of the beginning of the line

height: is the vertical length of the line

color: line is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawPixel(*args)[source]

void drawPixel(int8_t x, int8_t y, uint8_t color=COLOR_WHITE)

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

x: the x position of the pixel

y: the y position of the pixel

color: pixel is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRectangle(*args)[source]

void drawRectangle(int8_t x, int8_t y, uint8_t width, uint8_t height, uint8_t color=COLOR_WHITE)

Draw a rectangle to the screen buffer.

x: the left edge

y: the top edge

width: sets the right edge

height: bottom edge

color: outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRectangleFilled(*args)[source]

void drawRectangleFilled(int8_t x, int8_t y, uint8_t width, uint8_t height, uint8_t color=COLOR_WHITE)

Draw a filled rectangle to the screen buffer.

x: the left edge

y: the top edge

width: sets the right edge

height: bottom edge

color: fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRoundCorners(x0, y0, radius, cornername, color)[source]

void drawRoundCorners(int8_t x0, int8_t y0, int16_t radius, uint8_t cornername, uint8_t color)

Draw a quarter circle arc to the screen buffer.

x0: the x coordinate of the arc’s center

y0: the y coordinate of the arc’s center

radius: the radius of the arc

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

color: outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRoundedCornersFilled(x0, y0, radius, cornername, delta, color)[source]

void drawRoundedCornersFilled(int8_t x0, int8_t y0, int16_t radius, uint8_t cornername, int16_t delta, uint8_t color)

Draw a quarter pie to the screen buffer.

x0: the x coordinate of the arc’s center

y0: the y coordinate of the arc’s center

radius: the radius of the arc

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

color: fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawRoundedRectangle(x, y, width, height, radius, color)[source]

void drawRoundedRectangle(int8_t x, int8_t y, int8_t width, int8_t height, int16_t radius, uint8_t color)

Draw a rectangle with rounded corners to the screen buffer.

x: the left edge

y: the top edge

width: sets the right edge

height: bottom edge

radius: of the rounded corners

color: outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawTriangle(*args)[source]

void drawTriangle(int8_t x0, int8_t y0, int8_t x1, int8_t y1, int8_t x2, int8_t y2, uint8_t color=COLOR_WHITE)

Draw a triangle to the screen buffer.

x0: the x coordinate of the first corner

y0: the y coordinate of the first corner

x1: the x coordinate of the second corner

y1: the y coordinate of the second corner

x2: the x coordinate of the third corner

y2: the y coordinate of the third corner

color: outline is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

drawTriangleFilled(x0, y0, x1, y1, x2, y2, color)[source]

void drawTriangleFilled(int8_t x0, int8_t y0, int8_t x1, int8_t y1, int8_t x2, int8_t y2, uint8_t color)

Draw a filled triangle to the screen buffer.

x0: the x coordinate of the first corner

y0: the y coordinate of the first corner

x1: the x coordinate of the second corner

y1: the y coordinate of the second corner

x2: the x coordinate of the third corner

y2: the y coordinate of the third corner

color: fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

fillScreen(*args)[source]

void fillScreen(uint8_t color=COLOR_WHITE)

Fill the screen buffer with specified color.

color: fill color is COLOR_WHITE, COLOR_BLACK or COLOR_XOR

home()[source]

mraa::Result home()

Return to coordinate 0,0

result of operation

refresh()[source]

mraa::Result refresh()

Draw the buffer to screen.

result of operation

setCursor(row, column)[source]

mraa::Result setCursor(int row, int column)

Set cursor to a coordinate

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

column: Axis on the horizontal scale This device supports 64 columns

result of operation

setTextColor(textColor)[source]

void setTextColor(uint8_t textColor)

Sets a text color for a message

textColor: Font color: COLOR_WHITE, COLOR_BLACK or COLOR_XOR

setTextSize(size)[source]

void setTextSize(uint8_t size)

Sets the size of the font

size: Font size

setTextWrap(wrap)[source]

void setTextWrap(uint8_t wrap)

Wraps a printed message

wrap: True (1) or false (0)

write(msg)[source]

mraa::Result write(std::string msg)

Write a string to LCD

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

result of operation

class pyupm_lcd.LCD(*args, **kwargs)[source]

Bases: object

clear()[source]

virtual mraa::Result clear()=0

home()[source]

virtual mraa::Result home()=0

name()[source]

std::string name()

setCursor(row, column)[source]

virtual mraa::Result setCursor(int row, int column)=0

write(*args)[source]

virtual mraa::Result write(std::string msg)=0

class pyupm_lcd.SSD1306(bus, address=60)[source]

Bases: pyupm_lcd.LCD

API for SSD1306 I2C-controlled OLED displays.

ID: ssd1306

Name: OLED Display

Other Names: Adafruit SSD1306 OLED Display 0.96”

Category: display

Manufacturer: adafruit

Link:https://www.adafruit.com/datasheets/SSD1306.pdf

Link:http://www.farnell.com/datasheets/609753.pdf

Connection: i2c 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.

C++ includes: ssd1306.hpp

clear()[source]

mraa::Result clear()

Clears the display of all characters

Result of the operation

dim(dim)[source]

void dim(bool dim)

Dims display

dim: True to dim display, false for max intensity

Result of last operation

draw(data, bytes)[source]

mraa::Result draw(uint8_t *data, int bytes)

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

data: Buffer to read

bytes: Number of bytes to read from the pointer

Result of the operation

home()[source]

mraa::Result home()

Returns to the original coordinates (0,0)

Result of the operation

invert(i)[source]

mraa::Result invert(bool i)

Inverts the display

i: true to invert, false for normal display

Result of the operation

setCursor(row, column)[source]

mraa::Result setCursor(int row, int column)

Sets the cursor to specified coordinates

row: Row to set the cursor to

column: Column to set the cursor to

Result of the operation

startscrolldiagleft(start, stop)[source]

void startscrolldiagleft(uint8_t start, uint8_t 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)

start: First row to scroll

stop: Last row to scroll

void

startscrolldiagright(start, stop)[source]

void startscrolldiagright(uint8_t start, uint8_t 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)

start: First row to scroll

stop: Last row to scroll

void

startscrollleft(start, stop)[source]

void startscrollleft(uint8_t start, uint8_t 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)

start: First row to scroll

stop: Last row to scroll

void

startscrollright(start, stop)[source]

void startscrollright(uint8_t start, uint8_t 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)

start: First row to scroll

stop: Last row to scroll

void

stopscroll()[source]

void stopscroll(void)

Stops display scrolling.

void

write(msg)[source]

mraa::Result write(std::string msg)

Writes a string to the LCD

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

Result of the operation

class pyupm_lcd.SSD1308(bus, address=60)[source]

Bases: pyupm_lcd.LCD

API for SSD1308 I2C-controlled OLED displays.

ID: ssd1308

Name: OLED Display

Other Names: Grove OLED Display 0.96”

Category: display

Manufacturer: seeed adafruit

Link:http://wiki.seeed.cc/Grove-OLED_Display_0.96inch/

Link:http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_0.96%22

Connection: i2c SSD1308 is a 128x64 dot-matrix OLED/PLED segment driver with a controller. This implementation was tested using the Grove LED 128*64 Display module, which is an OLED monochrome display.

C++ includes: ssd1308.hpp

clear()[source]

mraa::Result clear()

Clears the display of all characters

Result of the operation

draw(data, bytes)[source]

mraa::Result draw(uint8_t *data, int bytes)

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

data: Buffer to read

bytes: Number of bytes to read from the pointer

Result of the operation

home()[source]

mraa::Result home()

Returns to the original coordinates (0,0)

Result of the operation

setCursor(row, column)[source]

mraa::Result setCursor(int row, int column)

Sets the cursor to specified coordinates

row: Row to set the cursor to

column: Column to set the cursor to

Result of the operation

write(msg)[source]

mraa::Result write(std::string msg)

Writes a string to the LCD

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

Result of the operation

class pyupm_lcd.SSD1327(bus, address=60)[source]

Bases: pyupm_lcd.LCD

API for SSD1327 I2C-controlled OLED displays.

ID: ssd1327

Name: OLED Display

Other Names: Grove OLED Display 1.12”

Category: display

Manufacturer: seeed adafruit

Link:http://wiki.seeed.cc/Grove-OLED_Display_1.12inch/

Connection: i2c SSD1327 is a 96x96 dot-matrix OLED/PLED segment driver with a controller. This implementation was tested using the Grove LED 96*96 Display module, which is an OLED monochrome display.

C++ includes: ssd1327.hpp

clear()[source]

mraa::Result clear()

Clears the display of all characters

Result of the operation

draw(data, bytes)[source]

mraa::Result draw(uint8_t *data, int bytes)

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

data: Buffer to read

bytes: Number of bytes to read from the pointer

Result of the operation

home()[source]

mraa::Result home()

Returns to the original coordinates (0,0)

Result of the operation

setCursor(row, column)[source]

mraa::Result setCursor(int row, int column)

Sets the cursor to specified coordinates

row: Row to set the cursor to

column: Column to set the cursor to

Result of the operation

setGrayLevel(level)[source]

void setGrayLevel(uint8_t level)

Sets the gray level for the LCD panel

level: level from 0 to 255

Result of the operation

write(msg)[source]

mraa::Result write(std::string msg)

Writes a string to the LCD

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

Result of the operation

class pyupm_lcd.uint8Array(nelements)[source]

Bases: object

cast()[source]
static frompointer()