public class BrickletDualButton extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletDualButton.ButtonState |
class |
BrickletDualButton.LEDState |
static interface |
BrickletDualButton.StateChangedListener
This listener is called whenever a button is pressed.
|
Device.Identity
Modifier and Type | Field and Description |
---|---|
static short |
BUTTON_STATE_PRESSED |
static short |
BUTTON_STATE_RELEASED |
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_GET_BUTTON_STATE |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_LED_STATE |
static byte |
FUNCTION_SET_LED_STATE |
static byte |
FUNCTION_SET_SELECTED_LED_STATE |
static short |
LED_LEFT |
static short |
LED_RIGHT |
static short |
LED_STATE_AUTO_TOGGLE_OFF |
static short |
LED_STATE_AUTO_TOGGLE_ON |
static short |
LED_STATE_OFF |
static short |
LED_STATE_ON |
Constructor and Description |
---|
BrickletDualButton(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addStateChangedListener(BrickletDualButton.StateChangedListener listener)
Adds a StateChanged listener.
|
BrickletDualButton.ButtonState |
getButtonState()
Returns the current state for both buttons.
|
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.
|
BrickletDualButton.LEDState |
getLEDState()
Returns the current state of the LEDs, as set by
setLEDState(short, short) . |
void |
removeStateChangedListener(BrickletDualButton.StateChangedListener listener)
Removes a StateChanged listener.
|
void |
setLEDState(short ledL,
short ledR)
Sets the state of the LEDs.
|
void |
setSelectedLEDState(short led,
short state)
Sets the state of the selected LED (0 or 1).
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_SET_LED_STATE
public static final byte FUNCTION_GET_LED_STATE
public static final byte FUNCTION_GET_BUTTON_STATE
public static final byte FUNCTION_SET_SELECTED_LED_STATE
public static final byte FUNCTION_GET_IDENTITY
public static final short LED_STATE_AUTO_TOGGLE_ON
public static final short LED_STATE_AUTO_TOGGLE_OFF
public static final short LED_STATE_ON
public static final short LED_STATE_OFF
public static final short BUTTON_STATE_PRESSED
public static final short BUTTON_STATE_RELEASED
public static final short LED_LEFT
public static final short LED_RIGHT
public BrickletDualButton(java.lang.String uid, IPConnection ipcon)
public void setLEDState(short ledL, short ledR) throws TinkerforgeException
getLEDState()
or you
can use setSelectedLEDState(short, short)
.TinkerforgeException
public BrickletDualButton.LEDState getLEDState() throws TinkerforgeException
setLEDState(short, short)
.TinkerforgeException
public BrickletDualButton.ButtonState getButtonState() throws TinkerforgeException
TinkerforgeException
public void setSelectedLEDState(short led, short state) throws TinkerforgeException
TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addStateChangedListener(BrickletDualButton.StateChangedListener listener)
public void removeStateChangedListener(BrickletDualButton.StateChangedListener listener)
Copyright © 2021 Tinkerforge GmbH. All rights reserved.