This is the description of the TCP/IP protocol for the Dual Button Bricklet. General information and technical specifications for the Dual Button Bricklet are summarized in its hardware description.
A general description of the TCP/IP protocol structure can be found here.
BrickletDualButton.
set_led_state
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Sets the state of the LEDs. Possible states are:
In auto toggle mode the LED is toggled automatically at each press of a button.
If you just want to set one of the LEDs and don't know the current state
of the other LED, you can get the state with get_led_state
or you
can use set_selected_led_state
.
The following meanings are defined for the elements of this function:
For led_l:
For led_r:
BrickletDualButton.
get_led_state
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the current state of the LEDs, as set by set_led_state
.
The following meanings are defined for the elements of this function:
For led_l:
For led_r:
Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the current state for both buttons. Possible states are:
The following meanings are defined for the elements of this function:
For button_l:
For button_r:
BrickletDualButton.
set_selected_led_state
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Sets the state of the selected LED (0 or 1).
The other LED remains untouched.
The following meanings are defined for the elements of this function:
For led:
For state:
BrickletDualButton.
get_identity
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
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 Isolator Bricklet is always at position 'z'.
The device identifier numbers can be found here.
BrickletDualButton.
CALLBACK_STATE_CHANGED
¶Function ID: |
|
---|---|
Response: |
|
This callback is called whenever a button is pressed.
Possible states for buttons are:
Possible states for LEDs are:
The following meanings are defined for the elements of this function:
For button_l:
For button_r:
For led_l:
For led_r: