public class BrickletLCD16x2 extends Device
Modifier and Type | Class and Description |
---|---|
static interface |
BrickletLCD16x2.ButtonPressedListener
This listener is triggered when a button is pressed.
|
static interface |
BrickletLCD16x2.ButtonReleasedListener
This listener is triggered when a button is released.
|
class |
BrickletLCD16x2.Config |
Device.Identity
Modifier and Type | Field and Description |
---|---|
static String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_BACKLIGHT_OFF |
static byte |
FUNCTION_BACKLIGHT_ON |
static byte |
FUNCTION_CLEAR_DISPLAY |
static byte |
FUNCTION_GET_CONFIG |
static byte |
FUNCTION_GET_CUSTOM_CHARACTER |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_IS_BACKLIGHT_ON |
static byte |
FUNCTION_IS_BUTTON_PRESSED |
static byte |
FUNCTION_SET_CONFIG |
static byte |
FUNCTION_SET_CUSTOM_CHARACTER |
static byte |
FUNCTION_WRITE_LINE |
Constructor and Description |
---|
BrickletLCD16x2(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addButtonPressedListener(BrickletLCD16x2.ButtonPressedListener listener)
Adds a ButtonPressed listener.
|
void |
addButtonReleasedListener(BrickletLCD16x2.ButtonReleasedListener listener)
Adds a ButtonReleased listener.
|
void |
backlightOff()
Turns the backlight off.
|
void |
backlightOn()
Turns the backlight on.
|
void |
clearDisplay()
Deletes all characters from the display.
|
BrickletLCD16x2.Config |
getConfig()
Returns the configuration as set by
setConfig(boolean, boolean) . |
short[] |
getCustomCharacter(short index)
Returns the custom character for a given index, as set with
setCustomCharacter(short, short[]) . |
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.
|
boolean |
isBacklightOn()
Returns *true* if the backlight is on and *false* otherwise.
|
boolean |
isButtonPressed(short button)
Returns *true* if the button is pressed.
|
void |
removeButtonPressedListener(BrickletLCD16x2.ButtonPressedListener listener)
Removes a ButtonPressed listener.
|
void |
removeButtonReleasedListener(BrickletLCD16x2.ButtonReleasedListener listener)
Removes a ButtonReleased listener.
|
void |
setConfig(boolean cursor,
boolean blinking)
Configures if the cursor (shown as "_") should be visible and if it
should be blinking (shown as a blinking block).
|
void |
setCustomCharacter(short index,
short[] character)
The LCD 16x2 Bricklet can store up to 8 custom characters.
|
void |
writeLine(short line,
short position,
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 String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_WRITE_LINE
public static final byte FUNCTION_CLEAR_DISPLAY
public static final byte FUNCTION_BACKLIGHT_ON
public static final byte FUNCTION_BACKLIGHT_OFF
public static final byte FUNCTION_IS_BACKLIGHT_ON
public static final byte FUNCTION_SET_CONFIG
public static final byte FUNCTION_GET_CONFIG
public static final byte FUNCTION_IS_BUTTON_PRESSED
public static final byte FUNCTION_SET_CUSTOM_CHARACTER
public static final byte FUNCTION_GET_CUSTOM_CHARACTER
public static final byte FUNCTION_GET_IDENTITY
public BrickletLCD16x2(String uid, IPConnection ipcon)
public void writeLine(short line, short position, String text) throws TinkerforgeException
TinkerforgeException
public void clearDisplay() throws TinkerforgeException
TinkerforgeException
public void backlightOn() throws TinkerforgeException
TinkerforgeException
public void backlightOff() throws TinkerforgeException
TinkerforgeException
public boolean isBacklightOn() throws TinkerforgeException
TinkerforgeException
public void setConfig(boolean cursor, boolean blinking) throws TinkerforgeException
writeLine(short, short, String)
.TinkerforgeException
public BrickletLCD16x2.Config getConfig() throws TinkerforgeException
setConfig(boolean, boolean)
.TinkerforgeException
public boolean isButtonPressed(short button) throws TinkerforgeException
BrickletLCD16x2.ButtonPressedListener
and BrickletLCD16x2.ButtonReleasedListener
listeners.TinkerforgeException
public void setCustomCharacter(short index, short[] character) throws TinkerforgeException
writeLine(short, short, String)
by using the
characters with the byte representation 8 ("\\x08" or "\\u0008") to 15
("\\x0F" or "\\u000F").
You can play around with the custom characters in Brick Viewer since
version 2.0.1.
Custom characters are stored by the LCD in RAM, so they have to be set
after each startup.
.. versionadded:: 2.0.1$nbsp;(Plugin)TinkerforgeException
public short[] getCustomCharacter(short index) throws TinkerforgeException
setCustomCharacter(short, short[])
.
.. versionadded:: 2.0.1$nbsp;(Plugin)TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addButtonPressedListener(BrickletLCD16x2.ButtonPressedListener listener)
public void removeButtonPressedListener(BrickletLCD16x2.ButtonPressedListener listener)
public void addButtonReleasedListener(BrickletLCD16x2.ButtonReleasedListener listener)
public void removeButtonReleasedListener(BrickletLCD16x2.ButtonReleasedListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.