public class BrickletIndustrialDigitalOut4 extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletIndustrialDigitalOut4.Monoflop |
static interface |
BrickletIndustrialDigitalOut4.MonoflopDoneListener
This listener is triggered whenever a monoflop timer reaches 0.
|
Device.Identity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static byte |
FUNCTION_GET_AVAILABLE_FOR_GROUP |
static byte |
FUNCTION_GET_GROUP |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_MONOFLOP |
static byte |
FUNCTION_GET_VALUE |
static byte |
FUNCTION_SET_GROUP |
static byte |
FUNCTION_SET_MONOFLOP |
static byte |
FUNCTION_SET_SELECTED_VALUES |
static byte |
FUNCTION_SET_VALUE |
Constructor and Description |
---|
BrickletIndustrialDigitalOut4(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addMonoflopDoneListener(BrickletIndustrialDigitalOut4.MonoflopDoneListener listener)
Adds a MonoflopDone listener.
|
short |
getAvailableForGroup()
Returns a bitmask of ports that are available for grouping.
|
char[] |
getGroup()
Returns the group as set by
setGroup(char[]) |
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.
|
BrickletIndustrialDigitalOut4.Monoflop |
getMonoflop(short pin)
Returns (for the given pin) the current value and the time as set by
setMonoflop(int, int, long) as well as the remaining time until the value flips. |
int |
getValue()
Returns the bitmask as set by
setValue(int) . |
void |
removeMonoflopDoneListener(BrickletIndustrialDigitalOut4.MonoflopDoneListener listener)
Removes a MonoflopDone listener.
|
void |
setGroup(char[] group)
Sets a group of Digital Out 4 Bricklets that should work together.
|
void |
setMonoflop(int selectionMask,
int valueMask,
long time)
Configures a monoflop of the pins specified by the first parameter
bitmask.
|
void |
setSelectedValues(int selectionMask,
int valueMask)
Sets the output value with a bitmask, according to the selection mask.
|
void |
setValue(int valueMask)
Sets the output value with a bitmask (16bit).
|
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_VALUE
public static final byte FUNCTION_GET_VALUE
public static final byte FUNCTION_SET_MONOFLOP
public static final byte FUNCTION_GET_MONOFLOP
public static final byte FUNCTION_SET_GROUP
public static final byte FUNCTION_GET_GROUP
public static final byte FUNCTION_GET_AVAILABLE_FOR_GROUP
public static final byte FUNCTION_SET_SELECTED_VALUES
public static final byte FUNCTION_GET_IDENTITY
public BrickletIndustrialDigitalOut4(java.lang.String uid, IPConnection ipcon)
public void setValue(int valueMask) throws TinkerforgeException
setGroup(char[])
), the pins correspond to the
markings on the Industrial Digital Out 4 Bricklet.
If groups are used, the pins correspond to the element in the group.
Element 1 in the group will get pins 0-3, element 2 pins 4-7, element 3
pins 8-11 and element 4 pins 12-15.
All running monoflop timers will be aborted if this function is called.TinkerforgeException
public int getValue() throws TinkerforgeException
setValue(int)
.TinkerforgeException
public void setMonoflop(int selectionMask, int valueMask, long time) throws TinkerforgeException
TinkerforgeException
public BrickletIndustrialDigitalOut4.Monoflop getMonoflop(short pin) throws TinkerforgeException
setMonoflop(int, int, long)
as well as the remaining time until the value flips.
If the timer is not running currently, the remaining time will be returned
as 0.TinkerforgeException
public void setGroup(char[] group) throws TinkerforgeException
getAvailableForGroup()
.
The group consists of 4 elements. Element 1 in the group will get pins 0-3,
element 2 pins 4-7, element 3 pins 8-11 and element 4 pins 12-15.
Each element can either be one of the ports ('a' to 'd') or 'n' if it should
not be used.
For example: If you have two Digital Out 4 Bricklets connected to port A and
port B respectively, you could call with ``['a', 'b', 'n', 'n']``.
Now the pins on the Digital Out 4 on port A are assigned to 0-3 and the
pins on the Digital Out 4 on port B are assigned to 4-7. It is now possible
to call setValue(int)
and control two Bricklets at the same time.TinkerforgeException
public char[] getGroup() throws TinkerforgeException
setGroup(char[])
TinkerforgeException
public short getAvailableForGroup() throws TinkerforgeException
TinkerforgeException
public void setSelectedValues(int selectionMask, int valueMask) throws TinkerforgeException
setGroup(char[])
), the pins correspond to the
markings on the Industrial Digital Out 4 Bricklet.
If groups are used, the pins correspond to the element in the group.
Element 1 in the group will get pins 0-3, element 2 pins 4-7, element 3
pins 8-11 and element 4 pins 12-15.
Running monoflop timers for the selected pins will be aborted if this function
is called.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addMonoflopDoneListener(BrickletIndustrialDigitalOut4.MonoflopDoneListener listener)
public void removeMonoflopDoneListener(BrickletIndustrialDigitalOut4.MonoflopDoneListener listener)
Copyright © 2020 Tinkerforge GmbH. All rights reserved.