openHAB - OLED 64x48 Bricklet

Bemerkung

Die openHAB-Dokumentation ist nur auf Englisch verfügbar.

Warnung

The openHAB bindings are still in beta, but the development was stopped.

This is the description of the openHAB API bindings for the OLED 64x48 Bricklet. General information and technical specifications for the OLED 64x48 Bricklet are summarized in its hardware description.

An installation guide for the openHAB API bindings is part of their general description.

Thing

UID:
  • tinkerforge:brickletoled64x48:[UID]
Required firmware version:
  • 2.0.0
Firmware update supported:
  • yes
Channels:
Actions:
Parameters:
  • Contrast – Type: integer, Default: 143, Min: 0, Max: 255
  • Sets the contrast of the display (0-255).

  • Invert – Type: boolean, Default: false
  • Inverts the color (black/white) of the display.

Channels

Text

Text to display on the LCD. Command format is [line],[position],[text].

Additional ',' are handled as part of the text. Unicode characters are converted to the LCD character set if possible. Additionally you can use \x[two hex digits] to use a character of the LCD character set directly.

Type:
  • String
UID:
  • tinkerforge:brickletoled64x48:[UID]:BrickletOLED64x48Text
Read only:
  • No
Clear Display

Deletes all characters from the display.

Type:
  • Commands (String)
UID:
  • tinkerforge:brickletoled64x48:[UID]:BrickletOLED64x48ClearDisplay
Read only:
  • No
Commands:
  • Accepts any string

Actions

Actions can be used in rules by creating an action object. All actions return a Map<String, Object>. Returned values can be accessed by name, sometimes the type deduction needs some hints, as shown below:

val actions = getActions("tinkerforge", "tinkerforge:brickletoled64x48:[UID]")
val hwVersion = actions.brickletOLED64x48GetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickletOLED64x48Write(short[] data)
Parameters:
  • data – Type: short[], Length: 64, Range: [0 to 255]

Appends 64 byte of data to the window as set by NewWindow().

Each row has a height of 8 pixels which corresponds to one byte of data.

Example: if you call NewWindow() with column from 0 to 63 and row from 0 to 5 (the whole display) each call of Write() (red arrow) will write one row.

Display pixel order

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() will write the second row and so on. To fill the whole display you need to call Write() 6 times.

brickletOLED64x48NewWindow(short columnFrom, short columnTo, short rowFrom, short rowTo)
Parameters:
  • columnFrom – Type: short, Range: [0 to 63]
  • columnTo – Type: short, Range: [0 to 63]
  • rowFrom – Type: short, Range: [0 to 5]
  • rowTo – Type: short, Range: [0 to 5]

Sets the window in which you can write with Write(). One row has a height of 8 pixels.

brickletOLED64x48ClearDisplay()

Clears the current content of the window as set by NewWindow().

brickletOLED64x48WriteLine(short line, short position, String text)
Parameters:
  • line – Type: short, Range: [0 to 5]
  • position – Type: short, Range: [0 to 12]
  • text – Type: String, Length: up to 13

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 with Write() 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.

Advanced Actions

brickletOLED64x48GetDisplayConfiguration()
Return Map:
  • contrast – Type: short, Range: [0 to 255], Default: 143
  • invert – Type: boolean, Default: false

Returns the configuration as set by the thing configuration.

brickletOLED64x48GetIdentity()
Return Map:
  • uid – Type: String, Length: up to 8
  • connectedUid – Type: String, Length: up to 8
  • position – Type: char, Range: ['a' to 'h', 'z']
  • hardwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • firmwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • deviceIdentifier – Type: int, Range: [0 to 216 - 1]

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 Isolator Bricklet is always at position 'z'.

The device identifier numbers can be found here