public class BrickletOLED128x64 extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletOLED128x64.DisplayConfiguration |
Device.Identity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_CLEAR_DISPLAY |
static byte |
FUNCTION_GET_DISPLAY_CONFIGURATION |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_NEW_WINDOW |
static byte |
FUNCTION_SET_DISPLAY_CONFIGURATION |
static byte |
FUNCTION_WRITE |
static byte |
FUNCTION_WRITE_LINE |
Constructor and Description |
---|
BrickletOLED128x64(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
clearDisplay()
Clears the current content of the window as set by
newWindow(short, short, short, short) . |
BrickletOLED128x64.DisplayConfiguration |
getDisplayConfiguration()
Returns the configuration as set by
setDisplayConfiguration(short, boolean) . |
Device.Identity |
getIdentity()
Returns the UID, the UID where the Bricklet is connected to,
the position, the hardware and firmware version as well as the
device identifier.
|
void |
newWindow(short columnFrom,
short columnTo,
short rowFrom,
short rowTo)
Sets the window in which you can write with
write(short[]) . |
void |
setDisplayConfiguration(short contrast,
boolean invert)
Sets the configuration of the display.
|
void |
write(short[] data)
Appends 64 byte of data to the window as set by
newWindow(short, short, short, short) . |
void |
writeLine(short line,
short position,
java.lang.String text)
Writes text to a specific line with a specific position.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_WRITE
public static final byte FUNCTION_NEW_WINDOW
public static final byte FUNCTION_CLEAR_DISPLAY
public static final byte FUNCTION_SET_DISPLAY_CONFIGURATION
public static final byte FUNCTION_GET_DISPLAY_CONFIGURATION
public static final byte FUNCTION_WRITE_LINE
public static final byte FUNCTION_GET_IDENTITY
public BrickletOLED128x64(java.lang.String uid, IPConnection ipcon)
public void write(short[] data) throws TinkerforgeException
newWindow(short, short, short, short)
.
Each row has a height of 8 pixels which corresponds to one byte of data.
Example: if you call newWindow(short, short, short, short)
with column from 0 to 127 and row
from 0 to 7 (the whole display) each call of write(short[])
(red arrow) will
write half of a row.
.. image:: /Images/Bricklets/bricklet_oled_128x64_display.png
:scale: 100 %
:alt: Display pixel order
:align: center
:target: ../../_images/Bricklets/bricklet_oled_128x64_display.png
The LSB (D0) of each data byte is at the top and the MSB (D7) is at the
bottom of the row.
The next call of write(short[])
will write the second half of the row
and the next two the second row and so on. To fill the whole display
you need to call write(short[])
16 times.TinkerforgeException
public void newWindow(short columnFrom, short columnTo, short rowFrom, short rowTo) throws TinkerforgeException
write(short[])
. One row
has a height of 8 pixels.TinkerforgeException
public void clearDisplay() throws TinkerforgeException
newWindow(short, short, short, short)
.TinkerforgeException
public void setDisplayConfiguration(short contrast, boolean invert) throws TinkerforgeException
TinkerforgeException
public BrickletOLED128x64.DisplayConfiguration getDisplayConfiguration() throws TinkerforgeException
setDisplayConfiguration(short, boolean)
.TinkerforgeException
public void writeLine(short line, short position, java.lang.String text) throws TinkerforgeException
write(short[])
and then add text to it
afterwards.
The display uses a special 5x7 pixel charset. You can view the characters
of the charset in Brick Viewer.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
Copyright © 2021 Tinkerforge GmbH. All rights reserved.