Package com.tinkerforge
Class BrickletOLED64x48
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickletOLED64x48
-
public class BrickletOLED64x48 extends Device
1.68cm (0.66") OLED display with 64x48 pixels
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BrickletOLED64x48.DisplayConfiguration
-
Nested classes/interfaces inherited from class com.tinkerforge.Device
Device.Identity
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description BrickletOLED64x48(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearDisplay()
Clears the current content of the window as set bynewWindow(short, short, short, short)
.BrickletOLED64x48.DisplayConfiguration
getDisplayConfiguration()
Returns the configuration as set bysetDisplayConfiguration(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 withwrite(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 bynewWindow(short, short, short, short)
.void
writeLine(short line, short position, java.lang.String text)
Writes text to a specific line with a specific position.-
Methods inherited from class com.tinkerforge.DeviceBase
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
-
-
-
-
Field Detail
-
DEVICE_IDENTIFIER
public static final int DEVICE_IDENTIFIER
- See Also:
- Constant Field Values
-
DEVICE_DISPLAY_NAME
public static final java.lang.String DEVICE_DISPLAY_NAME
- See Also:
- Constant Field Values
-
FUNCTION_WRITE
public static final byte FUNCTION_WRITE
- See Also:
- Constant Field Values
-
FUNCTION_NEW_WINDOW
public static final byte FUNCTION_NEW_WINDOW
- See Also:
- Constant Field Values
-
FUNCTION_CLEAR_DISPLAY
public static final byte FUNCTION_CLEAR_DISPLAY
- See Also:
- Constant Field Values
-
FUNCTION_SET_DISPLAY_CONFIGURATION
public static final byte FUNCTION_SET_DISPLAY_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_DISPLAY_CONFIGURATION
public static final byte FUNCTION_GET_DISPLAY_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_LINE
public static final byte FUNCTION_WRITE_LINE
- See Also:
- Constant Field Values
-
FUNCTION_GET_IDENTITY
public static final byte FUNCTION_GET_IDENTITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickletOLED64x48
public BrickletOLED64x48(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
-
-
Method Detail
-
write
public void write(short[] data) throws TinkerforgeException
Appends 64 byte of data to the window as set bynewWindow(short, short, short, short)
. Each row has a height of 8 pixels which corresponds to one byte of data. Example: if you callnewWindow(short, short, short, short)
with column from 0 to 63 and row from 0 to 5 (the whole display) each call ofwrite(short[])
(red arrow) will write one row. .. image:: /Images/Bricklets/bricklet_oled_64x48_display.png :scale: 100 % :alt: Display pixel order :align: center :target: ../../_images/Bricklets/bricklet_oled_64x48_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 ofwrite(short[])
will write the second row and so on. To fill the whole display you need to callwrite(short[])
6 times.- Throws:
TinkerforgeException
-
newWindow
public void newWindow(short columnFrom, short columnTo, short rowFrom, short rowTo) throws TinkerforgeException
Sets the window in which you can write withwrite(short[])
. One row has a height of 8 pixels.- Throws:
TinkerforgeException
-
clearDisplay
public void clearDisplay() throws TinkerforgeException
Clears the current content of the window as set bynewWindow(short, short, short, short)
.- Throws:
TinkerforgeException
-
setDisplayConfiguration
public void setDisplayConfiguration(short contrast, boolean invert) throws TinkerforgeException
Sets the configuration of the display. You can set a contrast value from 0 to 255 and you can invert the color (black/white) of the display.- Throws:
TinkerforgeException
-
getDisplayConfiguration
public BrickletOLED64x48.DisplayConfiguration getDisplayConfiguration() throws TinkerforgeException
Returns the configuration as set bysetDisplayConfiguration(short, boolean)
.- Throws:
TinkerforgeException
-
writeLine
public void writeLine(short line, short position, java.lang.String text) throws TinkerforgeException
Writes text to a specific line with a specific position. The text can have a maximum of 13 characters. For example: (1, 4, "Hello") will write *Hello* in the middle of the second line of the display. You can draw to the display withwrite(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. The font conforms to code page 437.- Throws:
TinkerforgeException
-
getIdentity
public Device.Identity getIdentity() throws TinkerforgeException
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|- Specified by:
getIdentity
in classDevice
- Throws:
TinkerforgeException
-
-