upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for SSD1327 I2C-controlled OLED displays. More...

Detailed Description

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.

ssd1327.jpeg
upm::SSD1327 lcd(BUS_NUMBER, 0x3C);
// If you don't set the display to be white, the seeed logo will appear jagged
lcd.setGrayLevel(12);
lcd.draw(SeeedLogo, 96 * 96 / 8);
// Simple print hello world
for (uint8_t i = 0; i < 12; i++) {
lcd.setCursor(i, 0);
lcd.setGrayLevel(i);
lcd.write("Hello World");
}

Public Member Functions

 SSD1327 (int bus, int address=0x3C)
 
 ~SSD1327 ()
 
mraa::Result draw (uint8_t *data, int bytes)
 
void setGrayLevel (uint8_t level)
 
mraa::Result write (std::string msg)
 
mraa::Result setCursor (int row, int column)
 
mraa::Result clear ()
 
mraa::Result home ()
 
- Public Member Functions inherited from LCD
mraa::Result write (int x, int y, std::string msg)
 
std::string name ()
 

Additional Inherited Members

- Protected Attributes inherited from LCD
std::string m_name
 

Constructor & Destructor Documentation

SSD1327 ( int  bus,
int  address = 0x3C 
)

SSD1327 constructor; calls libmraa initialisation functions

Parameters
busI2C bus to use
addressSlave address the LCD is registered on

Here is the call graph for this function:

~SSD1327 ( )

SSD1327 destructor

Member Function Documentation

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

Parameters
dataBuffer to read
bytesNumber of bytes to read from the pointer
Returns
Result of the operation
void setGrayLevel ( uint8_t  level)

Sets the gray level for the LCD panel

Parameters
levellevel from 0 to 255
Returns
Result of the operation
mraa::Result write ( std::string  msg)
virtual

Writes a string to the LCD

Parameters
msgstd::string to write to the display; note: only ASCII characters are supported
Returns
Result of the operation

Implements LCD.

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

Sets the cursor to specified coordinates

Parameters
rowRow to set the cursor to
columnColumn to set the cursor to
Returns
Result of the operation

Implements LCD.

Here is the caller graph for this function:

mraa::Result clear ( )
virtual

Clears the display of all characters

Returns
Result of the operation

Implements LCD.

Here is the caller graph for this function:

mraa::Result home ( )
virtual

Returns to the original coordinates (0,0)

Returns
Result of the operation

Implements LCD.

Here is the call graph for this function:

Inheritance diagram for SSD1327:
Inheritance graph
[legend]
Collaboration diagram for SSD1327:
Collaboration graph
[legend]

The documentation for this class was generated from the following files: