Package com.tinkerforge
Class BrickletAnalogOut
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickletAnalogOut
-
public class BrickletAnalogOut extends Device
Generates configurable DC voltage between 0V and 5V
-
-
Nested Class Summary
-
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_MODE
static byte
FUNCTION_GET_VOLTAGE
static byte
FUNCTION_SET_MODE
static byte
FUNCTION_SET_VOLTAGE
static short
MODE_100K_TO_GROUND
static short
MODE_1K_TO_GROUND
static short
MODE_500K_TO_GROUND
static short
MODE_ANALOG_VALUE
-
Constructor Summary
Constructors Constructor Description BrickletAnalogOut(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.short
getMode()
Returns the mode as set bysetMode(short)
.int
getVoltage()
Returns the voltage as set bysetVoltage(int)
.void
setMode(short mode)
Sets the mode of the analog value.void
setVoltage(int voltage)
Sets the voltage.-
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_VOLTAGE
public static final byte FUNCTION_SET_VOLTAGE
- See Also:
- Constant Field Values
-
FUNCTION_GET_VOLTAGE
public static final byte FUNCTION_GET_VOLTAGE
- See Also:
- Constant Field Values
-
FUNCTION_SET_MODE
public static final byte FUNCTION_SET_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_MODE
public static final byte FUNCTION_GET_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_IDENTITY
public static final byte FUNCTION_GET_IDENTITY
- See Also:
- Constant Field Values
-
MODE_ANALOG_VALUE
public static final short MODE_ANALOG_VALUE
- See Also:
- Constant Field Values
-
MODE_1K_TO_GROUND
public static final short MODE_1K_TO_GROUND
- See Also:
- Constant Field Values
-
MODE_100K_TO_GROUND
public static final short MODE_100K_TO_GROUND
- See Also:
- Constant Field Values
-
MODE_500K_TO_GROUND
public static final short MODE_500K_TO_GROUND
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickletAnalogOut
public BrickletAnalogOut(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
-
setVoltage
public void setVoltage(int voltage) throws TinkerforgeException
Sets the voltage. Calling this function will set the mode to 0 (seesetMode(short)
).- Throws:
TinkerforgeException
-
getVoltage
public int getVoltage() throws TinkerforgeException
Returns the voltage as set bysetVoltage(int)
.- Throws:
TinkerforgeException
-
setMode
public void setMode(short mode) throws TinkerforgeException
Sets the mode of the analog value. Possible modes: * 0: Normal Mode (Analog value as set bysetVoltage(int)
is applied) * 1: 1k Ohm resistor to ground * 2: 100k Ohm resistor to ground * 3: 500k Ohm resistor to ground Setting the mode to 0 will result in an output voltage of 0 V. You can jump to a higher output voltage directly by callingsetVoltage(int)
.- Throws:
TinkerforgeException
-
getMode
public short getMode() throws TinkerforgeException
Returns the mode as set bysetMode(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
-
-