Package com.tinkerforge
Class BrickletRGBLED
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickletRGBLED
-
public class BrickletRGBLED extends Device
Controls one RGB LED
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BrickletRGBLED.RGBValue
-
Nested classes/interfaces inherited from class com.tinkerforge.Device
Device.Identity
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEVICE_DISPLAY_NAME
static int
DEVICE_IDENTIFIER
static byte
FUNCTION_GET_IDENTITY
static byte
FUNCTION_GET_RGB_VALUE
static byte
FUNCTION_SET_RGB_VALUE
-
Constructor Summary
Constructors Constructor Description BrickletRGBLED(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.BrickletRGBLED.RGBValue
getRGBValue()
Returns the *r*, *g* and *b* values of the LED as set bysetRGBValue(short, short, short)
.void
setRGBValue(short r, short g, short b)
Sets the *r*, *g* and *b* values for the LED.-
Methods inherited from class com.tinkerforge.DeviceBase
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
-
-
-
-
Field Detail
-
DEVICE_IDENTIFIER
public static final int DEVICE_IDENTIFIER
- See Also:
- Constant Field Values
-
DEVICE_DISPLAY_NAME
public static final java.lang.String DEVICE_DISPLAY_NAME
- See Also:
- Constant Field Values
-
FUNCTION_SET_RGB_VALUE
public static final byte FUNCTION_SET_RGB_VALUE
- See Also:
- Constant Field Values
-
FUNCTION_GET_RGB_VALUE
public static final byte FUNCTION_GET_RGB_VALUE
- See Also:
- Constant Field Values
-
FUNCTION_GET_IDENTITY
public static final byte FUNCTION_GET_IDENTITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickletRGBLED
public BrickletRGBLED(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
-
-
Method Detail
-
setRGBValue
public void setRGBValue(short r, short g, short b) throws TinkerforgeException
Sets the *r*, *g* and *b* values for the LED.- Throws:
TinkerforgeException
-
getRGBValue
public BrickletRGBLED.RGBValue getRGBValue() throws TinkerforgeException
Returns the *r*, *g* and *b* values of the LED as set bysetRGBValue(short, short, short)
.- Throws:
TinkerforgeException
-
getIdentity
public Device.Identity getIdentity() throws TinkerforgeException
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 :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|- Specified by:
getIdentity
in classDevice
- Throws:
TinkerforgeException
-
-