openHAB - LCD 128x64 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 LCD 128x64 Bricklet. General information and technical specifications for the LCD 128x64 Bricklet are summarized in its hardware description.

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

Examples

The example code below is Public Domain (CC0 1.0).

GUI

Download (ExampleGUI.rules)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
val DIRECTION_HORIZONTAL = 0
val GRAPH_TYPE_LINE = 1
val CHANGE_TAB_ON_CLICK_AND_SWIPE = 3

rule "Init GUI"
when
    // This trigger ensures, that the GUI is recreated if connection to the brick daemon is lost, or the stack was unplugged.
    // Change XYZ to the UID of your LCD 128x64 Bricklet
    Thing tinkerforge:brickletlcd128x64:XYZ changed from INITIALIZING to ONLINE
then
    // Change XYZ to the UID of your LCD 128x64 Bricklet
    val lcd = getActions("tinkerforge", "tinkerforge:brickletlcd128x64:XYZ")

    // Clear display
    lcd.brickletLCD128x64ClearDisplay()
    lcd.brickletLCD128x64RemoveAllGUI()

    // Add GUI elements: Button, Slider and Graph with 60 data points
    lcd.brickletLCD128x64SetGUIButton(0, 0, 0, 60, 20, "button");
    lcd.brickletLCD128x64SetGUISlider(0, 0, 30, 60, DIRECTION_HORIZONTAL, 50);
    lcd.brickletLCD128x64SetGUIGraphConfiguration(0, GRAPH_TYPE_LINE, 62, 0, 60, 52, "X", "Y");

    // Add a few data points (the remaining points will be 0)
    lcd.brickletLCD128x64SetGUIGraphData(0, newArrayList(20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240));

    // Add 5 text tabs without and configure it for click and swipe without auto-redraw
    lcd.brickletLCD128x64SetGUITabConfiguration(CHANGE_TAB_ON_CLICK_AND_SWIPE, false);
    lcd.brickletLCD128x64SetGUITabText(0, "Tab A");
    lcd.brickletLCD128x64SetGUITabText(1, "Tab B");
    lcd.brickletLCD128x64SetGUITabText(2, "Tab C");
    lcd.brickletLCD128x64SetGUITabText(3, "Tab D");
    lcd.brickletLCD128x64SetGUITabText(4, "Tab E");
end

Thing

UID:
  • tinkerforge:brickletlcd128x64:[UID]
Required firmware version:
  • 2.0.2
Firmware update supported:
  • yes
Channels:
Actions:
Parameters:
  • Contrast – Type: integer, Default: 14, Min: 0, Max: 63
  • Sets the contrast of the display.

  • Default Backlight Intensity – Type: integer, Default: 100, Min: 0, Max: 100
  • Sets the default backlight intensity of the display.

  • Invert – Type: boolean, Default: false
  • Inverts black and white pixels.

  • Automatic Draw – Type: boolean, Default: true
  • If automatic draw is enabled, the display is automatically updated when writing text or clearing the display. If it is disabled, the changes are written into an internal buffer and only shown on the display after triggering the Draw Buffered Frame channel.

  • Touch LED – Type: Choice, Default: Show Touch
  • The touch LED configuration. By default the LED is on if the LCD is touched. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is off.
  • Options: Off, On, Show Heartbeat, Show Touch

  • GUI Button Update Interval – Type: integer, Default: 100, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for the GUI buttons in milliseconds. A value of 0 disables automatic updates.

  • GUI Slider Update Interval – Type: integer, Default: 100, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for the GUI sliders in milliseconds. A value of 0 disables automatic updates.

  • Touch Position Update Interval – Type: integer, Default: 100, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for touch positions in milliseconds. A value of 0 disables automatic updates.

  • Touch Gesture Update Interval – Type: integer, Default: 100, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for touch gestures in milliseconds. A value of 0 disables automatic updates.

  • Status LED Configuration – Type: Choice, Default: Show Status
  • The status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
  • Options: Off, On, Show Heartbeat, Show Status

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.

PaperUI truncates whitespace at the start and end of commands. So to clear (parts of) a line, you can not use f.e. 1,2,[spaces]. Instead you can use the empty character like this 1,2,\xFE\xFE\xFE to delete three characters at Line 1, Column 2.

Type:
  • String
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64Text
Read only:
  • No
Clear Display

Deletes all characters from the display.

Type:
  • Commands (String)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64ClearDisplay
Read only:
  • No
Commands:
  • Accepts any string
Draw Buffered Frame

Draws the currently buffered frame.

Type:
  • Commands (String)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64DrawBufferedFrame
Read only:
  • No
Predicate:
  • This channel will only be available if Automatic Draw is enabled.
Commands:
  • Accepts any string
Backlight

The backlight intensity value.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64Backlight
Read only:
  • No
Range:
  • 0 to 100 (Step 1)
Touch Position

Triggers when a new touch position is available. You can then use the getTouchPosition action to query the touch position information.

Type:
  • Trigger (system.trigger)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64TouchPosition
Read only:
  • No
Touch Gesture

Triggers when a new touch gesture is available. You can then use the getTouchGesture action to query the touch gesture information.

Type:
  • Trigger (system.trigger)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64TouchGesture
Read only:
  • No
Selected GUI Tab

The index of the currently selected tab. If there are not tabs, the index is -1.

Type:
  • Number
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64SelectedGUITab
Read only:
  • No
Range:
  • -1 to 9 (Step 1)
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
GUI Button 0

Triggers when GUI Button 0 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton0
Read only:
  • No
GUI Button 1

Triggers when GUI Button 1 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton1
Read only:
  • No
GUI Button 2

Triggers when GUI Button 2 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton2
Read only:
  • No
GUI Button 3

Triggers when GUI Button 3 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton3
Read only:
  • No
GUI Button 4

Triggers when GUI Button 4 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton4
Read only:
  • No
GUI Button 5

Triggers when GUI Button 5 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton5
Read only:
  • No
GUI Button 6

Triggers when GUI Button 6 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton6
Read only:
  • No
GUI Button 7

Triggers when GUI Button 7 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton7
Read only:
  • No
GUI Button 8

Triggers when GUI Button 8 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton8
Read only:
  • No
GUI Button 9

Triggers when GUI Button 9 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton9
Read only:
  • No
GUI Button 10

Triggers when GUI Button 10 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton10
Read only:
  • No
GUI Button 11

Triggers when GUI Button 11 is pressed or released.

Type:
  • Trigger (system.rawbutton)
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUIButton11
Read only:
  • No
GUI Slider 0

The current slider value.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUISlider0
Read only:
  • Yes
Range:
  • 0 to 120 (Step 1)
GUI Slider 1

The current slider value.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUISlider1
Read only:
  • Yes
Range:
  • 0 to 120 (Step 1)
GUI Slider 2

The current slider value.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUISlider2
Read only:
  • Yes
Range:
  • 0 to 120 (Step 1)
GUI Slider 3

The current slider value.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUISlider3
Read only:
  • Yes
Range:
  • 0 to 120 (Step 1)
GUI Slider 4

The current slider value.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUISlider4
Read only:
  • Yes
Range:
  • 0 to 120 (Step 1)
GUI Slider 5

The current slider value.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletlcd128x64:[UID]:BrickletLCD128x64GUISlider5
Read only:
  • Yes
Range:
  • 0 to 120 (Step 1)

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:brickletlcd128x64:[UID]")
val hwVersion = actions.brickletLCD128x64GetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickletLCD128x64WritePixels(int xStart, int yStart, int xEnd, int yEnd, boolean[] pixels)
Parameters:
  • xStart – Type: int, Range: [0 to 127]
  • yStart – Type: int, Range: [0 to 63]
  • xEnd – Type: int, Range: [0 to 127]
  • yEnd – Type: int, Range: [0 to 63]
  • pixels – Type: boolean[], Length: variable

Writes pixels to the specified window.

The pixels are written into the window line by line top to bottom and each line is written from left to right.

If automatic draw is enabled (default) the pixels are directly written to the screen. Only pixels that have actually changed are updated on the screen, the rest stays the same.

If automatic draw is disabled the pixels are written to an internal buffer and the buffer is transferred to the display only after Draw Buffered Frame is called. This can be used to avoid flicker when drawing a complex frame in multiple steps.

Automatic draw can be configured with the Backlight function.

brickletLCD128x64ReadPixels(int xStart, int yStart, int xEnd, int yEnd)
Parameters:
  • xStart – Type: int, Range: [0 to 127]
  • yStart – Type: int, Range: [0 to 63]
  • xEnd – Type: int, Range: [0 to 127]
  • yEnd – Type: int, Range: [0 to 63]
Return Map:
  • pixels – Type: boolean[], Length: variable

Reads pixels from the specified window.

The pixels are read from the window line by line top to bottom and each line is read from left to right.

If automatic draw is enabled (default) the pixels that are read are always the same that are shown on the display.

If automatic draw is disabled the pixels are read from the internal buffer (see Draw Buffered Frame).

Automatic draw can be configured with the Backlight function.

brickletLCD128x64ClearDisplay()

Clears the complete content of the display.

If automatic draw is enabled (default) the pixels are directly cleared.

If automatic draw is disabled the the internal buffer is cleared and the buffer is transferred to the display only after Draw Buffered Frame is called. This can be used to avoid flicker when drawing a complex frame in multiple steps.

Automatic draw can be configured with the Backlight function.

brickletLCD128x64WriteLine(int line, int position, String text)
Parameters:
  • line – Type: int, Range: [0 to 7]
  • position – Type: int, Range: [0 to 21]
  • text – Type: String, Length: up to 22

Writes text to a specific line with a specific position.

For example: (1, 10, "Hello") will write Hello in the middle of the second line of the display.

The display uses a special 5x7 pixel charset. You can view the characters of the charset in Brick Viewer.

If automatic draw is enabled (default) the text is directly written to the screen. Only pixels that have actually changed are updated on the screen, the rest stays the same.

If automatic draw is disabled the text is written to an internal buffer and the buffer is transferred to the display only after Draw Buffered Frame is called. This can be used to avoid flicker when drawing a complex frame in multiple steps.

Automatic draw can be configured with the Backlight function.

This function is a 1:1 replacement for the function with the same name in the LCD 20x4 Bricklet. You can draw text at a specific pixel position and with different font sizes with the DrawText() function.

brickletLCD128x64DrawBufferedFrame(boolean forceCompleteRedraw)
Parameters:
  • forceCompleteRedraw – Type: boolean

Draws the currently buffered frame. Normally each call of WritePixels() and Text draws directly onto the display. If you turn automatic draw off (Backlight), the data is written in an internal buffer and only transferred to the display by calling this function. This can be used to avoid flicker when drawing a complex frame in multiple steps.

Set the force complete redraw to true to redraw the whole display instead of only the changed parts. Normally it should not be necessary to set this to true. It may only become necessary in case of stuck pixels because of errors.

brickletLCD128x64GetTouchPosition()
Return Map:
  • pressure – Type: int, Range: [0 to 300]
  • x – Type: int, Range: [0 to 127]
  • y – Type: int, Range: [0 to 63]
  • age – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]

Returns the last valid touch position:

  • Pressure: Amount of pressure applied by the user
  • X: Touch position on x-axis
  • Y: Touch position on y-axis
  • Age: Age of touch press (how long ago it was)
brickletLCD128x64GetTouchGesture()
Return Map:
  • gesture – Type: int, Range: See constants
  • duration – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]
  • pressureMax – Type: int, Range: [0 to 300]
  • xStart – Type: int, Range: [0 to 127]
  • yStart – Type: int, Range: [0 to 63]
  • xEnd – Type: int, Range: [0 to 127]
  • yEnd – Type: int, Range: [0 to 63]
  • age – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]

Returns one of four touch gestures that can be automatically detected by the Bricklet.

The gestures are swipes from left to right, right to left, top to bottom and bottom to top.

Additionally to the gestures a vector with a start and end position of the gesture is provided. You can use this vector do determine a more exact location of the gesture (e.g. the swipe from top to bottom was on the left or right part of the screen).

The age parameter corresponds to the age of gesture (how long ago it was).

The following constants are available for this function:

For gesture:

  • val GESTURE_LEFT_TO_RIGHT = 0
  • val GESTURE_RIGHT_TO_LEFT = 1
  • val GESTURE_TOP_TO_BOTTOM = 2
  • val GESTURE_BOTTOM_TO_TOP = 3
brickletLCD128x64DrawLine(int positionXStart, int positionYStart, int positionXEnd, int positionYEnd, boolean color)
Parameters:
  • positionXStart – Type: int, Range: [0 to 127]
  • positionYStart – Type: int, Range: [0 to 63]
  • positionXEnd – Type: int, Range: [0 to 127]
  • positionYEnd – Type: int, Range: [0 to 63]
  • color – Type: boolean

Draws a white or black line from (x, y)-start to (x, y)-end.

The following constants are available for this function:

For color:

  • val COLOR_WHITE = false
  • val COLOR_BLACK = true

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64DrawBox(int positionXStart, int positionYStart, int positionXEnd, int positionYEnd, boolean fill, boolean color)
Parameters:
  • positionXStart – Type: int, Range: [0 to 127]
  • positionYStart – Type: int, Range: [0 to 63]
  • positionXEnd – Type: int, Range: [0 to 127]
  • positionYEnd – Type: int, Range: [0 to 63]
  • fill – Type: boolean
  • color – Type: boolean

Draws a white or black box from (x, y)-start to (x, y)-end.

If you set fill to true, the box will be filled with the color. Otherwise only the outline will be drawn.

The following constants are available for this function:

For color:

  • val COLOR_WHITE = false
  • val COLOR_BLACK = true

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64DrawText(int positionX, int positionY, int font, boolean color, String text)
Parameters:
  • positionX – Type: int, Range: [0 to 127]
  • positionY – Type: int, Range: [0 to 63]
  • font – Type: int, Range: See constants
  • color – Type: boolean
  • text – Type: String, Length: up to 22

Draws a text at the pixel position (x, y).

You can use one of 9 different font sizes and draw the text in white or black.

The font conforms to code page 437.

The following constants are available for this function:

For font:

  • val FONT_6X8 = 0
  • val FONT_6X16 = 1
  • val FONT_6X24 = 2
  • val FONT_6X32 = 3
  • val FONT_12X16 = 4
  • val FONT_12X24 = 5
  • val FONT_12X32 = 6
  • val FONT_18X24 = 7
  • val FONT_18X32 = 8
  • val FONT_24X32 = 9

For color:

  • val COLOR_WHITE = false
  • val COLOR_BLACK = true

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUIButton(int index, int positionX, int positionY, int width, int height, String text)
Parameters:
  • index – Type: int, Range: [0 to 11]
  • positionX – Type: int, Range: [0 to 127]
  • positionY – Type: int, Range: [0 to 63]
  • width – Type: int, Range: [1 to 128]
  • height – Type: int, Range: [1 to 64]
  • text – Type: String, Length: up to 16

Draws a clickable button at position (x, y) with the given text.

You can use up to 12 buttons.

The x position + width has to be within the range of 1 to 128 and the y position + height has to be within the range of 1 to 64.

The minimum useful width/height of a button is 3.

You can enable a channel for a button press with the thing configuration. The channel will be triggered for press and release-events.

The button is drawn in a separate GUI buffer and the button-frame will always stay on top of the graphics drawn with WritePixels(). To remove the button use RemoveGUIButton().

If you want an icon instead of text, you can draw the icon inside of the button with WritePixels().

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUIButton(int index)
Parameters:
  • index – Type: int, Range: [0 to 11]
Return Map:
  • active – Type: boolean
  • positionX – Type: int, Range: [0 to 127]
  • positionY – Type: int, Range: [0 to 63]
  • width – Type: int, Range: [1 to 128]
  • height – Type: int, Range: [1 to 64]
  • text – Type: String, Length: up to 16

Returns the button properties for a given Index as set by SetGUIButton().

Additionally the Active parameter shows if a button is currently active/visible or not.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64RemoveGUIButton(int index)
Parameters:
  • index – Type: int, Range: [0 to 11, 255]

Removes the button with the given index.

You can use index 255 to remove all buttons.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUIButtonPressed(int index)
Parameters:
  • index – Type: int, Range: [0 to 11]
Return Map:
  • pressed – Type: boolean

Returns the state of the button for the given index.

The state can either be pressed (true) or released (false).

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUISlider(int index, int positionX, int positionY, int length, int direction, int value)
Parameters:
  • index – Type: int, Range: [0 to 5]
  • positionX – Type: int, Range: [0 to 128]
  • positionY – Type: int, Range: [0 to 64]
  • length – Type: int, Range: [8 to 128]
  • direction – Type: int, Range: See constants
  • value – Type: int, Range: [0 to 120]

Draws a slider at position (x, y) with the given length.

You can use up to 6 sliders.

If you use the horizontal direction, the x position + length has to be within the range of 1 to 128 and the y position has to be within the range of 0 to 46.

If you use the vertical direction, the y position + length has to be within the range of 1 to 64 and the x position has to be within the range of 0 to 110.

The minimum length of a slider is 8.

The parameter value is the start-position of the slider, it can be between 0 and length-8.

You can enable a channel for the slider value with the thing configuration.

The slider is drawn in a separate GUI buffer and it will always stay on top of the graphics drawn with WritePixels(). To remove the button use RemoveGUISlider().

The following constants are available for this function:

For direction:

  • val DIRECTION_HORIZONTAL = 0
  • val DIRECTION_VERTICAL = 1

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUISlider(int index)
Parameters:
  • index – Type: int, Range: [0 to 5]
Return Map:
  • active – Type: boolean
  • positionX – Type: int, Range: [0 to 128]
  • positionY – Type: int, Range: [0 to 64]
  • length – Type: int, Range: [8 to 128]
  • direction – Type: int, Range: See constants
  • value – Type: int, Range: [0 to 120]

Returns the slider properties for a given Index as set by SetGUISlider().

Additionally the Active parameter shows if a button is currently active/visible or not.

The following constants are available for this function:

For direction:

  • val DIRECTION_HORIZONTAL = 0
  • val DIRECTION_VERTICAL = 1

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64RemoveGUISlider(int index)
Parameters:
  • index – Type: int, Range: [0 to 5, 255]

Removes the slider with the given index.

You can use index 255 to remove all slider.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUISliderValue(int index)
Parameters:
  • index – Type: int, Range: [0 to 5]
Return Map:
  • value – Type: int, Range: [0 to 120]

Returns the current slider value for the given index.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUITabConfiguration(int changeTabConfig, boolean clearGUI)
Parameters:
  • changeTabConfig – Type: int, Range: See constants, Default: 3
  • clearGUI – Type: boolean, Default: true

Sets the general configuration for tabs. You can configure the tabs to only accept clicks or only swipes (gesture left/right and right/left) or both.

Additionally, if you set Clear GUI to true, all of the GUI elements (buttons, slider, graphs) will automatically be removed on every tab change.

The following constants are available for this function:

For changeTabConfig:

  • val CHANGE_TAB_ON_CLICK = 1
  • val CHANGE_TAB_ON_SWIPE = 2
  • val CHANGE_TAB_ON_CLICK_AND_SWIPE = 3

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUITabConfiguration()
Return Map:
  • changeTabConfig – Type: int, Range: See constants, Default: 3
  • clearGUI – Type: boolean, Default: true

Returns the tab configuration as set by SetGUITabConfiguration().

The following constants are available for this function:

For changeTabConfig:

  • val CHANGE_TAB_ON_CLICK = 1
  • val CHANGE_TAB_ON_SWIPE = 2
  • val CHANGE_TAB_ON_CLICK_AND_SWIPE = 3

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUITabText(int index, String text)
Parameters:
  • index – Type: int, Range: [0 to 9]
  • text – Type: String, Length: up to 5

Adds a text-tab with the given index.

You can use up to 10 tabs.

A text-tab with the same index as a icon-tab will overwrite the icon-tab.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUITabText(int index)
Parameters:
  • index – Type: int, Range: [0 to 9]
Return Map:
  • active – Type: boolean
  • text – Type: String, Length: up to 5

Returns the text for a given index as set by SetGUITabText().

Additionally the Active parameter shows if the tab is currently active/visible or not.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUITabIcon(int index, boolean[] icon)
Parameters:
  • index – Type: int, Range: [0 to 9]
  • icon – Type: boolean[], Length: 168

Adds a icon-tab with the given index. The icon can have a width of 28 pixels with a height of 6 pixels. It is drawn line-by-line from left to right.

You can use up to 10 tabs.

A icon-tab with the same index as a text-tab will overwrite the text-tab.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUITabIcon(int index)
Parameters:
  • index – Type: int, Range: [0 to 9]
Return Map:
  • active – Type: boolean
  • icon – Type: boolean[], Length: 168

Returns the icon for a given index as set by SetGUITabIcon().

Additionally the Active parameter shows if the tab is currently active/visible or not.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64RemoveGUITab(int index)
Parameters:
  • index – Type: int, Range: [0 to 9, 255]

Removes the tab with the given index.

You can use index 255 to remove all tabs.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUITabSelected(int index)
Parameters:
  • index – Type: int, Range: [0 to 9]

Sets the tab with the given index as selected (drawn as selected on the display).

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUITabSelected()
Return Map:
  • index – Type: int, Range: [-1 to 9]

Returns the index of the currently selected tab. If there are not tabs, the returned index is -1.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUIGraphConfiguration(int index, int graphType, int positionX, int positionY, int width, int height, String textX, String textY)
Parameters:
  • index – Type: int, Range: [0 to 3]
  • graphType – Type: int, Range: See constants
  • positionX – Type: int, Range: [0 to 127]
  • positionY – Type: int, Range: [0 to 63]
  • width – Type: int, Range: [0 to 118]
  • height – Type: int, Range: [0 to 63]
  • textX – Type: String, Length: up to 4
  • textY – Type: String, Length: up to 4

Sets the configuration for up to four graphs.

The graph type can be dot-, line- or bar-graph.

The x and y position are pixel positions.

You can add a text for the x and y axis. The text is drawn at the inside of the graph and it can overwrite some of the graph data. If you need the text outside of the graph you can leave this text here empty and use DrawText() to draw the caption outside of the graph.

The data of the graph can be set and updated with SetGUIGraphData().

The graph is drawn in a separate GUI buffer and the graph-frame and data will always stay on top of the graphics drawn with WritePixels(). To remove the graph use RemoveGUIGraph().

The following constants are available for this function:

For graphType:

  • val GRAPH_TYPE_DOT = 0
  • val GRAPH_TYPE_LINE = 1
  • val GRAPH_TYPE_BAR = 2

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUIGraphConfiguration(int index)
Parameters:
  • index – Type: int, Range: [0 to 3]
Return Map:
  • active – Type: boolean
  • graphType – Type: int, Range: See constants
  • positionX – Type: int, Range: [0 to 127]
  • positionY – Type: int, Range: [0 to 63]
  • width – Type: int, Range: [0 to 118]
  • height – Type: int, Range: [0 to 63]
  • textX – Type: String, Length: up to 4
  • textY – Type: String, Length: up to 4

Returns the graph properties for a given Index as set by SetGUIGraphConfiguration().

Additionally the Active parameter shows if a graph is currently active/visible or not.

The following constants are available for this function:

For graphType:

  • val GRAPH_TYPE_DOT = 0
  • val GRAPH_TYPE_LINE = 1
  • val GRAPH_TYPE_BAR = 2

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64SetGUIGraphData(int index, int[] data)
Parameters:
  • index – Type: int, Range: [0 to 3]
  • data – Type: int[], Length: variable, Range: [0 to 255]

Sets the data for a graph with the given index. You have to configure the graph with SetGUIGraphConfiguration() before you can set the first data.

The graph will show the first n values of the data that you set, where n is the width set with SetGUIGraphConfiguration(). If you set less then n values it will show the rest of the values as zero.

The maximum number of data-points you can set is 118 (which also corresponds to the maximum width of the graph).

You have to scale your values to be between 0 and 255. 0 will be shown at the bottom of the graph and 255 at the top.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetGUIGraphData(int index)
Parameters:
  • index – Type: int, Range: [0 to 3]
Return Map:
  • data – Type: int[], Length: variable, Range: [0 to 255]

Returns the graph data for a given index as set by SetGUIGraphData().

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64RemoveGUIGraph(int index)
Parameters:
  • index – Type: int, Range: [0 to 3, 255]

Removes the graph with the given index.

You can use index 255 to remove all graphs.

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64RemoveAllGUI()

Removes all GUI elements (buttons, slider, graphs, tabs).

Neu in Version 2.0.2 (Plugin).

Advanced Actions

brickletLCD128x64GetDisplayConfiguration()
Return Map:
  • contrast – Type: int, Range: [0 to 63], Default: 14
  • backlight – Type: int, Range: [0 to 100], Default: 100
  • invert – Type: boolean, Default: false
  • automaticDraw – Type: boolean, Default: true

Returns the configuration as set by Backlight.

brickletLCD128x64GetTouchLEDConfig()
Return Map:
  • config – Type: int, Range: See constants, Default: 3

Returns the configuration as set by the thing configuration

The following constants are available for this function:

For config:

  • val TOUCH_LED_CONFIG_OFF = 0
  • val TOUCH_LED_CONFIG_ON = 1
  • val TOUCH_LED_CONFIG_SHOW_HEARTBEAT = 2
  • val TOUCH_LED_CONFIG_SHOW_TOUCH = 3

Neu in Version 2.0.2 (Plugin).

brickletLCD128x64GetChipTemperature()
Return Map:
  • temperature – Type: int, Unit: 1 °C, Range: [-215 to 215 - 1]

Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!

The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.

brickletLCD128x64GetStatusLEDConfig()
Return Map:
  • config – Type: int, Range: See constants, Default: 3

Returns the configuration as set by the thing configuration

The following constants are available for this function:

For config:

  • val STATUS_LED_CONFIG_OFF = 0
  • val STATUS_LED_CONFIG_ON = 1
  • val STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2
  • val STATUS_LED_CONFIG_SHOW_STATUS = 3
brickletLCD128x64GetSPITFPErrorCount()
Return Map:
  • errorCountAckChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountMessageChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountFrame – Type: long, Range: [0 to 232 - 1]
  • errorCountOverflow – Type: long, Range: [0 to 232 - 1]

Returns the error count for the communication between Brick and Bricklet.

The errors are divided into

  • ACK checksum errors,
  • message checksum errors,
  • framing errors and
  • overflow errors.

The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.

brickletLCD128x64Reset()

Calling this function will reset the Bricklet. All configurations will be lost.

After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!

brickletLCD128x64GetIdentity()
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

Internal Actions

brickletLCD128x64ReadUID()
Return Map:
  • uid – Type: long, Range: [0 to 232 - 1]

Returns the current UID as an integer. Encode as Base58 to get the usual string version.