This is the description of the TCP/IP protocol for the Accelerometer Bricklet. General information and technical specifications for the Accelerometer Bricklet are summarized in its hardware description.
A general description of the TCP/IP protocol structure can be found here.
BrickletAccelerometer.
get_acceleration
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the acceleration in x, y and z direction. The values
are given in gₙ/1000 (1gₙ = 9.80665m/s²). The range is
configured with set_configuration
.
If you want to get the acceleration periodically, it is recommended
to use the CALLBACK_ACCELERATION
callback and set the period with
set_acceleration_callback_period
.
BrickletAccelerometer.
get_temperature
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the temperature of the accelerometer.
BrickletAccelerometer.
led_on
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Enables the LED on the Bricklet.
BrickletAccelerometer.
led_off
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Disables the LED on the Bricklet.
BrickletAccelerometer.
is_led_on
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns true if the LED is enabled, false otherwise.
BrickletAccelerometer.
set_configuration
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Configures the data rate, full scale range and filter bandwidth. Possible values are:
Decreasing data rate or full scale range will also decrease the noise on the data.
The following meanings are defined for the elements of this function:
For data_rate:
For full_scale:
For filter_bandwidth:
BrickletAccelerometer.
get_configuration
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the configuration as set by set_configuration
.
The following meanings are defined for the elements of this function:
For data_rate:
For full_scale:
For filter_bandwidth:
BrickletAccelerometer.
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.
BrickletAccelerometer.
set_acceleration_callback_period
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Sets the period with which the CALLBACK_ACCELERATION
callback is triggered
periodically. A value of 0 turns the callback off.
The CALLBACK_ACCELERATION
callback is only triggered if the acceleration has
changed since the last triggering.
BrickletAccelerometer.
get_acceleration_callback_period
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the period as set by set_acceleration_callback_period
.
BrickletAccelerometer.
set_acceleration_callback_threshold
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Sets the thresholds for the CALLBACK_ACCELERATION_REACHED
callback.
The following options are possible:
Option | Description |
---|---|
'x' | Callback is turned off |
'o' | Callback is triggered when the acceleration is outside the min and max values |
'i' | Callback is triggered when the acceleration is inside the min and max values |
'<' | Callback is triggered when the acceleration is smaller than the min value (max is ignored) |
'>' | Callback is triggered when the acceleration is greater than the min value (max is ignored) |
The following meanings are defined for the elements of this function:
For option:
BrickletAccelerometer.
get_acceleration_callback_threshold
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the threshold as set by set_acceleration_callback_threshold
.
The following meanings are defined for the elements of this function:
For option:
BrickletAccelerometer.
set_debounce_period
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Sets the period with which the threshold callback
is triggered, if the threshold
keeps being reached.
BrickletAccelerometer.
get_debounce_period
¶Function ID: |
|
---|---|
Request: |
|
Response: |
|
Returns the debounce period as set by set_debounce_period
.
BrickletAccelerometer.
CALLBACK_ACCELERATION
¶Function ID: |
|
---|---|
Response: |
|
This callback is triggered periodically with the period that is set by
set_acceleration_callback_period
. The response values are the
X, Y and Z acceleration. The range is
configured with set_configuration
.
The CALLBACK_ACCELERATION
callback is only triggered if the acceleration has
changed since the last triggering.
BrickletAccelerometer.
CALLBACK_ACCELERATION_REACHED
¶Function ID: |
|
---|---|
Response: |
|
This callback is triggered when the threshold as set by
set_acceleration_callback_threshold
is reached.
The response values are the X, Y and Z acceleration. The range is
configured with set_configuration
.
If the threshold keeps being reached, the callback is triggered periodically
with the period as set by set_debounce_period
.