public class BrickletMultiTouch extends Device
Modifier and Type | Class and Description |
---|---|
static interface |
BrickletMultiTouch.TouchStateListener
Returns the current touch state, see
getTouchState() for
information about the state. |
Device.Identity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_GET_ELECTRODE_CONFIG |
static byte |
FUNCTION_GET_ELECTRODE_SENSITIVITY |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_TOUCH_STATE |
static byte |
FUNCTION_RECALIBRATE |
static byte |
FUNCTION_SET_ELECTRODE_CONFIG |
static byte |
FUNCTION_SET_ELECTRODE_SENSITIVITY |
Constructor and Description |
---|
BrickletMultiTouch(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addTouchStateListener(BrickletMultiTouch.TouchStateListener listener)
Adds a TouchState listener.
|
int |
getElectrodeConfig()
Returns the electrode configuration, as set by
setElectrodeConfig(int) . |
short |
getElectrodeSensitivity()
Returns the current sensitivity, as set by
setElectrodeSensitivity(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.
|
int |
getTouchState()
Returns the current touch state.
|
void |
recalibrate()
Recalibrates the electrodes.
|
void |
removeTouchStateListener(BrickletMultiTouch.TouchStateListener listener)
Removes a TouchState listener.
|
void |
setElectrodeConfig(int enabledElectrodes)
Enables/disables electrodes with a bitfield (see
getTouchState() ). |
void |
setElectrodeSensitivity(short sensitivity)
Sets the sensitivity of the electrodes.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_TOUCH_STATE
public static final byte FUNCTION_RECALIBRATE
public static final byte FUNCTION_SET_ELECTRODE_CONFIG
public static final byte FUNCTION_GET_ELECTRODE_CONFIG
public static final byte FUNCTION_SET_ELECTRODE_SENSITIVITY
public static final byte FUNCTION_GET_ELECTRODE_SENSITIVITY
public static final byte FUNCTION_GET_IDENTITY
public BrickletMultiTouch(java.lang.String uid, IPConnection ipcon)
public int getTouchState() throws TinkerforgeException
TinkerforgeException
public void recalibrate() throws TinkerforgeException
TinkerforgeException
public void setElectrodeConfig(int enabledElectrodes) throws TinkerforgeException
getTouchState()
).
*True* enables the electrode, *false* disables the electrode. A
disabled electrode will always return *false* as its state. If you
don't need all electrodes you can disable the electrodes that are
not needed.
It is recommended that you disable the proximity bit (bit 12) if
the proximity feature is not needed. This will reduce the amount of
traffic that is produced by the BrickletMultiTouch.TouchStateListener
listener.
Disabling electrodes will also reduce power consumption.
Default: 8191 = 0x1FFF = 0b1111111111111 (all electrodes and proximity feature enabled)TinkerforgeException
public int getElectrodeConfig() throws TinkerforgeException
setElectrodeConfig(int)
.TinkerforgeException
public void setElectrodeSensitivity(short sensitivity) throws TinkerforgeException
recalibrate()
to calibrate the electrodes with the newly defined sensitivity.TinkerforgeException
public short getElectrodeSensitivity() throws TinkerforgeException
setElectrodeSensitivity(short)
.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addTouchStateListener(BrickletMultiTouch.TouchStateListener listener)
public void removeTouchStateListener(BrickletMultiTouch.TouchStateListener listener)
Copyright © 2020 Tinkerforge GmbH. All rights reserved.