OLED (use with mDesigner)
The organic light-emitting diode (OLED) module is a display module capable of displaying information, shapes, images, etc on its 0.96-inch 128x64 (pixel) screen. Support for this trinket is found in mDesigner.
The OLED module can be connected to a project in two ways. Either stacking or connecting to a sensor hub using a wire.
Method 1: Stacking
Stack directly onto an mBattery or mCenter+.
Method 2: Connecting with a Wire
Connecting the OLED screen to a sensor hub with a wire allows for the OLED to be positioned in different locations.
The following pins on the Hub or mCenter+'s Hub support this module:
|Pin I2C||Yes||Any I2C / IIC pin.|
The OLED screen has a screen resolution of 128 pixel wide by 64 high.
The OLED blocks "x" and "y" values reference the screen resolution with origin (0,0).
The origin (0, 0) is on the top left of the screen (in reference to image below).
OLED - Display Message
This block displays a message on the OLED screen. The bottom left corner of the text is aligned to the "x" and y" input. Each character (default) is about 10 pixels tall.
OLED - Draw Line
This block draws a line on the OLED screen. With the starting point as (x0, y0) and the ending point as (x1, y1). The line width is about 1 pixel.
- line / rectangle - draw either a line or rectangle. Leave on line to draw a line.
- Start point - x0, y0
- End point - x1, y1
OLED - Draw Rectangle
This block draws a rectangle on the OLED screen. With the top left corner point as (x0, y0) and the bottom right corner point as (x1, y1). The line width is about 1 pixel.
This block uses the OLED - Draw Line block, but configured for a rectangle.
- line / rectangle - draw either a line or rectangle. Change to rectangle to draw a rectangle.
- Top left corner - x0, y0
- Bottom right corner - x1, y1
OLED - Draw Circle
This block draws a circle on the OLED screen. With the center of the on the "x" and "y" inputs with a radius of "r".
OLED - Clear
This block clears the contents of the OLED screen of any drawn contents, such as text, shapes, etc.