tinkerforge 2.1.26 → 2.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/tinkerforge/brick_dc.rb +3 -3
- data/lib/tinkerforge/brick_hat.rb +5 -7
- data/lib/tinkerforge/brick_hat_zero.rb +5 -7
- data/lib/tinkerforge/brick_imu.rb +3 -3
- data/lib/tinkerforge/brick_imu_v2.rb +3 -3
- data/lib/tinkerforge/brick_master.rb +3 -3
- data/lib/tinkerforge/brick_red.rb +2 -2
- data/lib/tinkerforge/brick_servo.rb +3 -3
- data/lib/tinkerforge/brick_silent_stepper.rb +3 -3
- data/lib/tinkerforge/brick_stepper.rb +3 -3
- data/lib/tinkerforge/bricklet_accelerometer.rb +3 -4
- data/lib/tinkerforge/bricklet_accelerometer_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_air_quality.rb +3 -4
- data/lib/tinkerforge/bricklet_ambient_light.rb +3 -4
- data/lib/tinkerforge/bricklet_ambient_light_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_ambient_light_v3.rb +3 -4
- data/lib/tinkerforge/bricklet_analog_in.rb +3 -4
- data/lib/tinkerforge/bricklet_analog_in_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_analog_in_v3.rb +3 -4
- data/lib/tinkerforge/bricklet_analog_out.rb +3 -4
- data/lib/tinkerforge/bricklet_analog_out_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_analog_out_v3.rb +3 -4
- data/lib/tinkerforge/bricklet_barometer.rb +3 -4
- data/lib/tinkerforge/bricklet_barometer_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_can.rb +3 -4
- data/lib/tinkerforge/bricklet_can_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_co2.rb +3 -4
- data/lib/tinkerforge/bricklet_co2_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_color.rb +3 -4
- data/lib/tinkerforge/bricklet_color_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_compass.rb +3 -4
- data/lib/tinkerforge/bricklet_current12.rb +3 -4
- data/lib/tinkerforge/bricklet_current25.rb +3 -4
- data/lib/tinkerforge/bricklet_distance_ir.rb +3 -4
- data/lib/tinkerforge/bricklet_distance_ir_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_distance_us.rb +3 -4
- data/lib/tinkerforge/bricklet_distance_us_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_dmx.rb +3 -4
- data/lib/tinkerforge/bricklet_dual_button.rb +3 -4
- data/lib/tinkerforge/bricklet_dual_button_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_dual_relay.rb +3 -4
- data/lib/tinkerforge/bricklet_dust_detector.rb +3 -4
- data/lib/tinkerforge/bricklet_e_paper_296x128.rb +3 -4
- data/lib/tinkerforge/bricklet_energy_monitor.rb +3 -4
- data/lib/tinkerforge/bricklet_gps.rb +3 -4
- data/lib/tinkerforge/bricklet_gps_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_hall_effect.rb +3 -4
- data/lib/tinkerforge/bricklet_hall_effect_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_humidity.rb +3 -4
- data/lib/tinkerforge/bricklet_humidity_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_imu_v3.rb +784 -0
- data/lib/tinkerforge/bricklet_industrial_analog_out.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_counter.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +4 -5
- data/lib/tinkerforge/bricklet_industrial_dual_ac_relay.rb +325 -0
- data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +3 -4
- data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_io16.rb +3 -4
- data/lib/tinkerforge/bricklet_io16_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_io4.rb +3 -4
- data/lib/tinkerforge/bricklet_io4_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_isolator.rb +4 -5
- data/lib/tinkerforge/bricklet_joystick.rb +3 -4
- data/lib/tinkerforge/bricklet_joystick_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_laser_range_finder.rb +3 -4
- data/lib/tinkerforge/bricklet_laser_range_finder_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_lcd_128x64.rb +3 -4
- data/lib/tinkerforge/bricklet_lcd_16x2.rb +3 -4
- data/lib/tinkerforge/bricklet_lcd_20x4.rb +3 -4
- data/lib/tinkerforge/bricklet_led_strip.rb +3 -4
- data/lib/tinkerforge/bricklet_led_strip_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_line.rb +3 -4
- data/lib/tinkerforge/bricklet_linear_poti.rb +3 -4
- data/lib/tinkerforge/bricklet_linear_poti_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_load_cell.rb +3 -4
- data/lib/tinkerforge/bricklet_load_cell_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_moisture.rb +3 -4
- data/lib/tinkerforge/bricklet_motion_detector.rb +3 -4
- data/lib/tinkerforge/bricklet_motion_detector_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +3 -4
- data/lib/tinkerforge/bricklet_multi_touch.rb +3 -4
- data/lib/tinkerforge/bricklet_multi_touch_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_nfc.rb +7 -8
- data/lib/tinkerforge/bricklet_nfc_rfid.rb +3 -4
- data/lib/tinkerforge/bricklet_oled_128x64.rb +3 -4
- data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_oled_64x48.rb +3 -4
- data/lib/tinkerforge/bricklet_one_wire.rb +3 -4
- data/lib/tinkerforge/bricklet_outdoor_weather.rb +4 -5
- data/lib/tinkerforge/bricklet_particulate_matter.rb +3 -4
- data/lib/tinkerforge/bricklet_piezo_buzzer.rb +3 -4
- data/lib/tinkerforge/bricklet_piezo_speaker.rb +3 -4
- data/lib/tinkerforge/bricklet_piezo_speaker_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_ptc.rb +3 -4
- data/lib/tinkerforge/bricklet_ptc_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_real_time_clock.rb +3 -4
- data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_remote_switch.rb +3 -4
- data/lib/tinkerforge/bricklet_remote_switch_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_rgb_led.rb +3 -4
- data/lib/tinkerforge/bricklet_rgb_led_button.rb +3 -4
- data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +3 -4
- data/lib/tinkerforge/bricklet_rgb_led_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_rotary_encoder.rb +3 -4
- data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_rotary_poti.rb +3 -4
- data/lib/tinkerforge/bricklet_rotary_poti_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_rs232.rb +3 -4
- data/lib/tinkerforge/bricklet_rs232_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_rs485.rb +3 -4
- data/lib/tinkerforge/bricklet_segment_display_4x7.rb +3 -4
- data/lib/tinkerforge/bricklet_segment_display_4x7_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_solid_state_relay.rb +3 -4
- data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_sound_intensity.rb +3 -4
- data/lib/tinkerforge/bricklet_sound_pressure_level.rb +3 -4
- data/lib/tinkerforge/bricklet_temperature.rb +3 -4
- data/lib/tinkerforge/bricklet_temperature_ir.rb +3 -4
- data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_temperature_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_thermal_imaging.rb +3 -4
- data/lib/tinkerforge/bricklet_thermocouple.rb +3 -4
- data/lib/tinkerforge/bricklet_thermocouple_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_tilt.rb +3 -4
- data/lib/tinkerforge/bricklet_uv_light.rb +3 -4
- data/lib/tinkerforge/bricklet_uv_light_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_voltage.rb +3 -4
- data/lib/tinkerforge/bricklet_voltage_current.rb +3 -4
- data/lib/tinkerforge/bricklet_voltage_current_v2.rb +3 -4
- data/lib/tinkerforge/bricklet_xmc1400_breakout.rb +3 -4
- data/lib/tinkerforge/device_display_names.rb +5 -3
- data/lib/tinkerforge/version.rb +1 -1
- metadata +5 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2020-
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
6
|
# #
|
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
|
@@ -350,8 +350,7 @@ module Tinkerforge
|
|
|
350
350
|
# device identifier.
|
|
351
351
|
#
|
|
352
352
|
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
353
|
-
#
|
|
354
|
-
# connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
|
|
353
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
355
354
|
# position 'z'.
|
|
356
355
|
#
|
|
357
356
|
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2020-
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
6
|
# #
|
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
|
@@ -306,8 +306,7 @@ module Tinkerforge
|
|
|
306
306
|
# device identifier.
|
|
307
307
|
#
|
|
308
308
|
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
309
|
-
#
|
|
310
|
-
# connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
|
|
309
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
311
310
|
# position 'z'.
|
|
312
311
|
#
|
|
313
312
|
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2020-
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
6
|
# #
|
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
|
@@ -559,8 +559,7 @@ module Tinkerforge
|
|
|
559
559
|
# device identifier.
|
|
560
560
|
#
|
|
561
561
|
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
562
|
-
#
|
|
563
|
-
# connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
|
|
562
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
564
563
|
# position 'z'.
|
|
565
564
|
#
|
|
566
565
|
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2020-
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
6
|
# #
|
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
|
@@ -164,8 +164,7 @@ module Tinkerforge
|
|
|
164
164
|
# device identifier.
|
|
165
165
|
#
|
|
166
166
|
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
167
|
-
#
|
|
168
|
-
# connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
|
|
167
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
169
168
|
# position 'z'.
|
|
170
169
|
#
|
|
171
170
|
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2020-
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
6
|
# #
|
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
|
@@ -347,8 +347,7 @@ module Tinkerforge
|
|
|
347
347
|
# device identifier.
|
|
348
348
|
#
|
|
349
349
|
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
350
|
-
#
|
|
351
|
-
# connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
|
|
350
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
352
351
|
# position 'z'.
|
|
353
352
|
#
|
|
354
353
|
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2020-
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
6
|
# #
|
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
|
@@ -242,8 +242,7 @@ module Tinkerforge
|
|
|
242
242
|
# device identifier.
|
|
243
243
|
#
|
|
244
244
|
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
245
|
-
#
|
|
246
|
-
# connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
|
|
245
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
247
246
|
# position 'z'.
|
|
248
247
|
#
|
|
249
248
|
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2020-
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
6
|
# #
|
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
|
@@ -422,8 +422,7 @@ module Tinkerforge
|
|
|
422
422
|
# device identifier.
|
|
423
423
|
#
|
|
424
424
|
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
425
|
-
#
|
|
426
|
-
# connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
|
|
425
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
427
426
|
# position 'z'.
|
|
428
427
|
#
|
|
429
428
|
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
# -*- ruby encoding: utf-8 -*-
|
|
2
|
+
#############################################################
|
|
3
|
+
# This file was automatically generated on 2020-11-02. #
|
|
4
|
+
# #
|
|
5
|
+
# Ruby Bindings Version 2.1.27 #
|
|
6
|
+
# #
|
|
7
|
+
# If you have a bugfix for this file and want to commit it, #
|
|
8
|
+
# please fix the bug in the generator. You can find a link #
|
|
9
|
+
# to the generators git repository on tinkerforge.com #
|
|
10
|
+
#############################################################
|
|
11
|
+
|
|
12
|
+
require_relative './ip_connection'
|
|
13
|
+
|
|
14
|
+
module Tinkerforge
|
|
15
|
+
# Full fledged AHRS with 9 degrees of freedom
|
|
16
|
+
class BrickletIMUV3 < Device
|
|
17
|
+
DEVICE_IDENTIFIER = 2161 # :nodoc:
|
|
18
|
+
DEVICE_DISPLAY_NAME = 'IMU Bricklet 3.0' # :nodoc:
|
|
19
|
+
|
|
20
|
+
# This callback is triggered periodically with the period that is set by
|
|
21
|
+
# BrickletIMUV3#set_acceleration_callback_configuration. The parameters are the acceleration
|
|
22
|
+
# for the x, y and z axis.
|
|
23
|
+
CALLBACK_ACCELERATION = 33
|
|
24
|
+
|
|
25
|
+
# This callback is triggered periodically with the period that is set by
|
|
26
|
+
# BrickletIMUV3#set_magnetic_field_callback_configuration. The parameters are the magnetic
|
|
27
|
+
# field for the x, y and z axis.
|
|
28
|
+
CALLBACK_MAGNETIC_FIELD = 34
|
|
29
|
+
|
|
30
|
+
# This callback is triggered periodically with the period that is set by
|
|
31
|
+
# BrickletIMUV3#set_angular_velocity_callback_configuration. The parameters are the angular
|
|
32
|
+
# velocity for the x, y and z axis.
|
|
33
|
+
CALLBACK_ANGULAR_VELOCITY = 35
|
|
34
|
+
|
|
35
|
+
# This callback is triggered periodically with the period that is set by
|
|
36
|
+
# BrickletIMUV3#set_temperature_callback_configuration. The parameter is the temperature.
|
|
37
|
+
CALLBACK_TEMPERATURE = 36
|
|
38
|
+
|
|
39
|
+
# This callback is triggered periodically with the period that is set by
|
|
40
|
+
# BrickletIMUV3#set_linear_acceleration_callback_configuration. The parameters are the
|
|
41
|
+
# linear acceleration for the x, y and z axis.
|
|
42
|
+
CALLBACK_LINEAR_ACCELERATION = 37
|
|
43
|
+
|
|
44
|
+
# This callback is triggered periodically with the period that is set by
|
|
45
|
+
# BrickletIMUV3#set_gravity_vector_callback_configuration. The parameters gravity vector
|
|
46
|
+
# for the x, y and z axis.
|
|
47
|
+
CALLBACK_GRAVITY_VECTOR = 38
|
|
48
|
+
|
|
49
|
+
# This callback is triggered periodically with the period that is set by
|
|
50
|
+
# BrickletIMUV3#set_orientation_callback_configuration. The parameters are the orientation
|
|
51
|
+
# (heading (yaw), roll, pitch) of the IMU Brick in Euler angles. See
|
|
52
|
+
# BrickletIMUV3#get_orientation for details.
|
|
53
|
+
CALLBACK_ORIENTATION = 39
|
|
54
|
+
|
|
55
|
+
# This callback is triggered periodically with the period that is set by
|
|
56
|
+
# BrickletIMUV3#set_quaternion_callback_configuration. The parameters are the orientation
|
|
57
|
+
# (w, x, y, z) of the IMU Brick in quaternions. See BrickletIMUV3#get_quaternion
|
|
58
|
+
# for details.
|
|
59
|
+
CALLBACK_QUATERNION = 40
|
|
60
|
+
|
|
61
|
+
# This callback is triggered periodically with the period that is set by
|
|
62
|
+
# BrickletIMUV3#set_all_data_callback_configuration. The parameters are as for
|
|
63
|
+
# BrickletIMUV3#get_all_data.
|
|
64
|
+
CALLBACK_ALL_DATA = 41
|
|
65
|
+
|
|
66
|
+
FUNCTION_GET_ACCELERATION = 1 # :nodoc:
|
|
67
|
+
FUNCTION_GET_MAGNETIC_FIELD = 2 # :nodoc:
|
|
68
|
+
FUNCTION_GET_ANGULAR_VELOCITY = 3 # :nodoc:
|
|
69
|
+
FUNCTION_GET_TEMPERATURE = 4 # :nodoc:
|
|
70
|
+
FUNCTION_GET_ORIENTATION = 5 # :nodoc:
|
|
71
|
+
FUNCTION_GET_LINEAR_ACCELERATION = 6 # :nodoc:
|
|
72
|
+
FUNCTION_GET_GRAVITY_VECTOR = 7 # :nodoc:
|
|
73
|
+
FUNCTION_GET_QUATERNION = 8 # :nodoc:
|
|
74
|
+
FUNCTION_GET_ALL_DATA = 9 # :nodoc:
|
|
75
|
+
FUNCTION_SAVE_CALIBRATION = 10 # :nodoc:
|
|
76
|
+
FUNCTION_SET_SENSOR_CONFIGURATION = 11 # :nodoc:
|
|
77
|
+
FUNCTION_GET_SENSOR_CONFIGURATION = 12 # :nodoc:
|
|
78
|
+
FUNCTION_SET_SENSOR_FUSION_MODE = 13 # :nodoc:
|
|
79
|
+
FUNCTION_GET_SENSOR_FUSION_MODE = 14 # :nodoc:
|
|
80
|
+
FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION = 15 # :nodoc:
|
|
81
|
+
FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION = 16 # :nodoc:
|
|
82
|
+
FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION = 17 # :nodoc:
|
|
83
|
+
FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION = 18 # :nodoc:
|
|
84
|
+
FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION = 19 # :nodoc:
|
|
85
|
+
FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION = 20 # :nodoc:
|
|
86
|
+
FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION = 21 # :nodoc:
|
|
87
|
+
FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION = 22 # :nodoc:
|
|
88
|
+
FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION = 23 # :nodoc:
|
|
89
|
+
FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION = 24 # :nodoc:
|
|
90
|
+
FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION = 25 # :nodoc:
|
|
91
|
+
FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION = 26 # :nodoc:
|
|
92
|
+
FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION = 27 # :nodoc:
|
|
93
|
+
FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION = 28 # :nodoc:
|
|
94
|
+
FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION = 29 # :nodoc:
|
|
95
|
+
FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION = 30 # :nodoc:
|
|
96
|
+
FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION = 31 # :nodoc:
|
|
97
|
+
FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION = 32 # :nodoc:
|
|
98
|
+
FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
|
|
99
|
+
FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
|
|
100
|
+
FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
|
|
101
|
+
FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
|
|
102
|
+
FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
|
|
103
|
+
FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
|
|
104
|
+
FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
|
|
105
|
+
FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
|
|
106
|
+
FUNCTION_RESET = 243 # :nodoc:
|
|
107
|
+
FUNCTION_WRITE_UID = 248 # :nodoc:
|
|
108
|
+
FUNCTION_READ_UID = 249 # :nodoc:
|
|
109
|
+
FUNCTION_GET_IDENTITY = 255 # :nodoc:
|
|
110
|
+
|
|
111
|
+
MAGNETOMETER_RATE_2HZ = 0 # :nodoc:
|
|
112
|
+
MAGNETOMETER_RATE_6HZ = 1 # :nodoc:
|
|
113
|
+
MAGNETOMETER_RATE_8HZ = 2 # :nodoc:
|
|
114
|
+
MAGNETOMETER_RATE_10HZ = 3 # :nodoc:
|
|
115
|
+
MAGNETOMETER_RATE_15HZ = 4 # :nodoc:
|
|
116
|
+
MAGNETOMETER_RATE_20HZ = 5 # :nodoc:
|
|
117
|
+
MAGNETOMETER_RATE_25HZ = 6 # :nodoc:
|
|
118
|
+
MAGNETOMETER_RATE_30HZ = 7 # :nodoc:
|
|
119
|
+
GYROSCOPE_RANGE_2000DPS = 0 # :nodoc:
|
|
120
|
+
GYROSCOPE_RANGE_1000DPS = 1 # :nodoc:
|
|
121
|
+
GYROSCOPE_RANGE_500DPS = 2 # :nodoc:
|
|
122
|
+
GYROSCOPE_RANGE_250DPS = 3 # :nodoc:
|
|
123
|
+
GYROSCOPE_RANGE_125DPS = 4 # :nodoc:
|
|
124
|
+
GYROSCOPE_BANDWIDTH_523HZ = 0 # :nodoc:
|
|
125
|
+
GYROSCOPE_BANDWIDTH_230HZ = 1 # :nodoc:
|
|
126
|
+
GYROSCOPE_BANDWIDTH_116HZ = 2 # :nodoc:
|
|
127
|
+
GYROSCOPE_BANDWIDTH_47HZ = 3 # :nodoc:
|
|
128
|
+
GYROSCOPE_BANDWIDTH_23HZ = 4 # :nodoc:
|
|
129
|
+
GYROSCOPE_BANDWIDTH_12HZ = 5 # :nodoc:
|
|
130
|
+
GYROSCOPE_BANDWIDTH_64HZ = 6 # :nodoc:
|
|
131
|
+
GYROSCOPE_BANDWIDTH_32HZ = 7 # :nodoc:
|
|
132
|
+
ACCELEROMETER_RANGE_2G = 0 # :nodoc:
|
|
133
|
+
ACCELEROMETER_RANGE_4G = 1 # :nodoc:
|
|
134
|
+
ACCELEROMETER_RANGE_8G = 2 # :nodoc:
|
|
135
|
+
ACCELEROMETER_RANGE_16G = 3 # :nodoc:
|
|
136
|
+
ACCELEROMETER_BANDWIDTH_7_81HZ = 0 # :nodoc:
|
|
137
|
+
ACCELEROMETER_BANDWIDTH_15_63HZ = 1 # :nodoc:
|
|
138
|
+
ACCELEROMETER_BANDWIDTH_31_25HZ = 2 # :nodoc:
|
|
139
|
+
ACCELEROMETER_BANDWIDTH_62_5HZ = 3 # :nodoc:
|
|
140
|
+
ACCELEROMETER_BANDWIDTH_125HZ = 4 # :nodoc:
|
|
141
|
+
ACCELEROMETER_BANDWIDTH_250HZ = 5 # :nodoc:
|
|
142
|
+
ACCELEROMETER_BANDWIDTH_500HZ = 6 # :nodoc:
|
|
143
|
+
ACCELEROMETER_BANDWIDTH_1000HZ = 7 # :nodoc:
|
|
144
|
+
SENSOR_FUSION_OFF = 0 # :nodoc:
|
|
145
|
+
SENSOR_FUSION_ON = 1 # :nodoc:
|
|
146
|
+
SENSOR_FUSION_ON_WITHOUT_MAGNETOMETER = 2 # :nodoc:
|
|
147
|
+
SENSOR_FUSION_ON_WITHOUT_FAST_MAGNETOMETER_CALIBRATION = 3 # :nodoc:
|
|
148
|
+
BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
|
|
149
|
+
BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
|
|
150
|
+
BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
|
|
151
|
+
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
|
|
152
|
+
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
|
|
153
|
+
BOOTLOADER_STATUS_OK = 0 # :nodoc:
|
|
154
|
+
BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
|
|
155
|
+
BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
|
|
156
|
+
BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
|
|
157
|
+
BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
|
|
158
|
+
BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
|
|
159
|
+
STATUS_LED_CONFIG_OFF = 0 # :nodoc:
|
|
160
|
+
STATUS_LED_CONFIG_ON = 1 # :nodoc:
|
|
161
|
+
STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
|
|
162
|
+
STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
|
|
163
|
+
|
|
164
|
+
# Creates an object with the unique device ID <tt>uid</tt> and adds it to
|
|
165
|
+
# the IP Connection <tt>ipcon</tt>.
|
|
166
|
+
def initialize(uid, ipcon)
|
|
167
|
+
super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
|
|
168
|
+
|
|
169
|
+
@api_version = [2, 0, 0]
|
|
170
|
+
|
|
171
|
+
@response_expected[FUNCTION_GET_ACCELERATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
172
|
+
@response_expected[FUNCTION_GET_MAGNETIC_FIELD] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
173
|
+
@response_expected[FUNCTION_GET_ANGULAR_VELOCITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
174
|
+
@response_expected[FUNCTION_GET_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
175
|
+
@response_expected[FUNCTION_GET_ORIENTATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
176
|
+
@response_expected[FUNCTION_GET_LINEAR_ACCELERATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
177
|
+
@response_expected[FUNCTION_GET_GRAVITY_VECTOR] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
178
|
+
@response_expected[FUNCTION_GET_QUATERNION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
179
|
+
@response_expected[FUNCTION_GET_ALL_DATA] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
180
|
+
@response_expected[FUNCTION_SAVE_CALIBRATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
181
|
+
@response_expected[FUNCTION_SET_SENSOR_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
|
|
182
|
+
@response_expected[FUNCTION_GET_SENSOR_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
183
|
+
@response_expected[FUNCTION_SET_SENSOR_FUSION_MODE] = RESPONSE_EXPECTED_FALSE
|
|
184
|
+
@response_expected[FUNCTION_GET_SENSOR_FUSION_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
185
|
+
@response_expected[FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
186
|
+
@response_expected[FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
187
|
+
@response_expected[FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
188
|
+
@response_expected[FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
189
|
+
@response_expected[FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
190
|
+
@response_expected[FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
191
|
+
@response_expected[FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
192
|
+
@response_expected[FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
193
|
+
@response_expected[FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
194
|
+
@response_expected[FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
195
|
+
@response_expected[FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
196
|
+
@response_expected[FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
197
|
+
@response_expected[FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
198
|
+
@response_expected[FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
199
|
+
@response_expected[FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
200
|
+
@response_expected[FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
201
|
+
@response_expected[FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
202
|
+
@response_expected[FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
203
|
+
@response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
204
|
+
@response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
205
|
+
@response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
206
|
+
@response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
|
|
207
|
+
@response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
208
|
+
@response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
|
|
209
|
+
@response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
210
|
+
@response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
211
|
+
@response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
|
|
212
|
+
@response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
|
|
213
|
+
@response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
214
|
+
@response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
215
|
+
|
|
216
|
+
@callback_formats[CALLBACK_ACCELERATION] = [14, 's s s']
|
|
217
|
+
@callback_formats[CALLBACK_MAGNETIC_FIELD] = [14, 's s s']
|
|
218
|
+
@callback_formats[CALLBACK_ANGULAR_VELOCITY] = [14, 's s s']
|
|
219
|
+
@callback_formats[CALLBACK_TEMPERATURE] = [9, 'c']
|
|
220
|
+
@callback_formats[CALLBACK_LINEAR_ACCELERATION] = [14, 's s s']
|
|
221
|
+
@callback_formats[CALLBACK_GRAVITY_VECTOR] = [14, 's s s']
|
|
222
|
+
@callback_formats[CALLBACK_ORIENTATION] = [14, 's s s']
|
|
223
|
+
@callback_formats[CALLBACK_QUATERNION] = [16, 's s s s']
|
|
224
|
+
@callback_formats[CALLBACK_ALL_DATA] = [54, 's3 s3 s3 s3 s4 s3 s3 c C']
|
|
225
|
+
|
|
226
|
+
@ipcon.add_device self
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Returns the calibrated acceleration from the accelerometer for the
|
|
230
|
+
# x, y and z axis. The acceleration is in the range configured with
|
|
231
|
+
# BrickletIMUV3#set_sensor_configuration.
|
|
232
|
+
#
|
|
233
|
+
# If you want to get the acceleration periodically, it is recommended
|
|
234
|
+
# to use the CALLBACK_ACCELERATION callback and set the period with
|
|
235
|
+
# BrickletIMUV3#set_acceleration_callback_configuration.
|
|
236
|
+
def get_acceleration
|
|
237
|
+
check_validity
|
|
238
|
+
|
|
239
|
+
send_request FUNCTION_GET_ACCELERATION, [], '', 14, 's s s'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Returns the calibrated magnetic field from the magnetometer for the
|
|
243
|
+
# x, y and z axis.
|
|
244
|
+
#
|
|
245
|
+
# If you want to get the magnetic field periodically, it is recommended
|
|
246
|
+
# to use the CALLBACK_MAGNETIC_FIELD callback and set the period with
|
|
247
|
+
# BrickletIMUV3#set_magnetic_field_callback_configuration.
|
|
248
|
+
def get_magnetic_field
|
|
249
|
+
check_validity
|
|
250
|
+
|
|
251
|
+
send_request FUNCTION_GET_MAGNETIC_FIELD, [], '', 14, 's s s'
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Returns the calibrated angular velocity from the gyroscope for the
|
|
255
|
+
# x, y and z axis. The angular velocity is in the range configured with
|
|
256
|
+
# BrickletIMUV3#set_sensor_configuration.
|
|
257
|
+
#
|
|
258
|
+
# If you want to get the angular velocity periodically, it is recommended
|
|
259
|
+
# to use the CALLBACK_ANGULAR_VELOCITY acallback nd set the period with
|
|
260
|
+
# BrickletIMUV3#set_angular_velocity_callback_configuration.
|
|
261
|
+
def get_angular_velocity
|
|
262
|
+
check_validity
|
|
263
|
+
|
|
264
|
+
send_request FUNCTION_GET_ANGULAR_VELOCITY, [], '', 14, 's s s'
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Returns the temperature of the IMU Brick.
|
|
268
|
+
# The temperature is measured in the core of the BNO055 IC, it is not the
|
|
269
|
+
# ambient temperature
|
|
270
|
+
def get_temperature
|
|
271
|
+
check_validity
|
|
272
|
+
|
|
273
|
+
send_request FUNCTION_GET_TEMPERATURE, [], '', 9, 'c'
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Returns the current orientation (heading, roll, pitch) of the IMU Brick as
|
|
277
|
+
# independent Euler angles. Note that Euler angles always
|
|
278
|
+
# experience a `gimbal lock <https://en.wikipedia.org/wiki/Gimbal_lock>`__.
|
|
279
|
+
# We recommend that you use quaternions instead, if you need the absolute
|
|
280
|
+
# orientation.
|
|
281
|
+
#
|
|
282
|
+
# If you want to get the orientation periodically, it is recommended
|
|
283
|
+
# to use the CALLBACK_ORIENTATION callback and set the period with
|
|
284
|
+
# BrickletIMUV3#set_orientation_callback_configuration.
|
|
285
|
+
def get_orientation
|
|
286
|
+
check_validity
|
|
287
|
+
|
|
288
|
+
send_request FUNCTION_GET_ORIENTATION, [], '', 14, 's s s'
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Returns the linear acceleration of the IMU Brick for the
|
|
292
|
+
# x, y and z axis. The acceleration is in the range configured with
|
|
293
|
+
# BrickletIMUV3#set_sensor_configuration.
|
|
294
|
+
#
|
|
295
|
+
# The linear acceleration is the acceleration in each of the three
|
|
296
|
+
# axis of the IMU Brick with the influences of gravity removed.
|
|
297
|
+
#
|
|
298
|
+
# It is also possible to get the gravity vector with the influence of linear
|
|
299
|
+
# acceleration removed, see BrickletIMUV3#get_gravity_vector.
|
|
300
|
+
#
|
|
301
|
+
# If you want to get the linear acceleration periodically, it is recommended
|
|
302
|
+
# to use the CALLBACK_LINEAR_ACCELERATION callback and set the period with
|
|
303
|
+
# BrickletIMUV3#set_linear_acceleration_callback_configuration.
|
|
304
|
+
def get_linear_acceleration
|
|
305
|
+
check_validity
|
|
306
|
+
|
|
307
|
+
send_request FUNCTION_GET_LINEAR_ACCELERATION, [], '', 14, 's s s'
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Returns the current gravity vector of the IMU Brick for the
|
|
311
|
+
# x, y and z axis.
|
|
312
|
+
#
|
|
313
|
+
# The gravity vector is the acceleration that occurs due to gravity.
|
|
314
|
+
# Influences of additional linear acceleration are removed.
|
|
315
|
+
#
|
|
316
|
+
# It is also possible to get the linear acceleration with the influence
|
|
317
|
+
# of gravity removed, see BrickletIMUV3#get_linear_acceleration.
|
|
318
|
+
#
|
|
319
|
+
# If you want to get the gravity vector periodically, it is recommended
|
|
320
|
+
# to use the CALLBACK_GRAVITY_VECTOR callback and set the period with
|
|
321
|
+
# BrickletIMUV3#set_gravity_vector_callback_configuration.
|
|
322
|
+
def get_gravity_vector
|
|
323
|
+
check_validity
|
|
324
|
+
|
|
325
|
+
send_request FUNCTION_GET_GRAVITY_VECTOR, [], '', 14, 's s s'
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Returns the current orientation (w, x, y, z) of the IMU Brick as
|
|
329
|
+
# `quaternions <https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation>`__.
|
|
330
|
+
#
|
|
331
|
+
# You have to divide the return values by 16383 (14 bit) to get
|
|
332
|
+
# the usual range of -1.0 to +1.0 for quaternions.
|
|
333
|
+
#
|
|
334
|
+
# If you want to get the quaternions periodically, it is recommended
|
|
335
|
+
# to use the CALLBACK_QUATERNION callback and set the period with
|
|
336
|
+
# BrickletIMUV3#set_quaternion_callback_configuration.
|
|
337
|
+
def get_quaternion
|
|
338
|
+
check_validity
|
|
339
|
+
|
|
340
|
+
send_request FUNCTION_GET_QUATERNION, [], '', 16, 's s s s'
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Return all of the available data of the IMU Brick.
|
|
344
|
+
#
|
|
345
|
+
# * acceleration (see BrickletIMUV3#get_acceleration)
|
|
346
|
+
# * magnetic field (see BrickletIMUV3#get_magnetic_field)
|
|
347
|
+
# * angular velocity (see BrickletIMUV3#get_angular_velocity)
|
|
348
|
+
# * Euler angles (see BrickletIMUV3#get_orientation)
|
|
349
|
+
# * quaternion (see BrickletIMUV3#get_quaternion)
|
|
350
|
+
# * linear acceleration (see BrickletIMUV3#get_linear_acceleration)
|
|
351
|
+
# * gravity vector (see BrickletIMUV3#get_gravity_vector)
|
|
352
|
+
# * temperature (see BrickletIMUV3#get_temperature)
|
|
353
|
+
# * calibration status (see below)
|
|
354
|
+
#
|
|
355
|
+
# The calibration status consists of four pairs of two bits. Each pair
|
|
356
|
+
# of bits represents the status of the current calibration.
|
|
357
|
+
#
|
|
358
|
+
# * bit 0-1: Magnetometer
|
|
359
|
+
# * bit 2-3: Accelerometer
|
|
360
|
+
# * bit 4-5: Gyroscope
|
|
361
|
+
# * bit 6-7: System
|
|
362
|
+
#
|
|
363
|
+
# A value of 0 means for "not calibrated" and a value of 3 means
|
|
364
|
+
# "fully calibrated". In your program you should always be able to
|
|
365
|
+
# ignore the calibration status, it is used by the calibration
|
|
366
|
+
# window of the Brick Viewer and it can be ignored after the first
|
|
367
|
+
# calibration. See the documentation in the calibration window for
|
|
368
|
+
# more information regarding the calibration of the IMU Brick.
|
|
369
|
+
#
|
|
370
|
+
# If you want to get the data periodically, it is recommended
|
|
371
|
+
# to use the CALLBACK_ALL_DATA callback and set the period with
|
|
372
|
+
# BrickletIMUV3#set_all_data_callback_configuration.
|
|
373
|
+
def get_all_data
|
|
374
|
+
check_validity
|
|
375
|
+
|
|
376
|
+
send_request FUNCTION_GET_ALL_DATA, [], '', 54, 's3 s3 s3 s3 s4 s3 s3 c C'
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# A call of this function saves the current calibration to be used
|
|
380
|
+
# as a starting point for the next restart of continuous calibration
|
|
381
|
+
# of the IMU Brick.
|
|
382
|
+
#
|
|
383
|
+
# A return value of *true* means that the calibration could be used and
|
|
384
|
+
# *false* means that it could not be used (this happens if the calibration
|
|
385
|
+
# status is not "fully calibrated").
|
|
386
|
+
#
|
|
387
|
+
# This function is used by the calibration window of the Brick Viewer, you
|
|
388
|
+
# should not need to call it in your program.
|
|
389
|
+
def save_calibration
|
|
390
|
+
check_validity
|
|
391
|
+
|
|
392
|
+
send_request FUNCTION_SAVE_CALIBRATION, [], '', 9, '?'
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
# Sets the available sensor configuration for the Magnetometer, Gyroscope and
|
|
396
|
+
# Accelerometer. The Accelerometer Range is user selectable in all fusion modes,
|
|
397
|
+
# all other configurations are auto-controlled in fusion mode.
|
|
398
|
+
def set_sensor_configuration(magnetometer_rate, gyroscope_range, gyroscope_bandwidth, accelerometer_range, accelerometer_bandwidth)
|
|
399
|
+
check_validity
|
|
400
|
+
|
|
401
|
+
send_request FUNCTION_SET_SENSOR_CONFIGURATION, [magnetometer_rate, gyroscope_range, gyroscope_bandwidth, accelerometer_range, accelerometer_bandwidth], 'C C C C C', 8, ''
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
# Returns the sensor configuration as set by BrickletIMUV3#set_sensor_configuration.
|
|
405
|
+
def get_sensor_configuration
|
|
406
|
+
check_validity
|
|
407
|
+
|
|
408
|
+
send_request FUNCTION_GET_SENSOR_CONFIGURATION, [], '', 13, 'C C C C C'
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# If the fusion mode is turned off, the functions BrickletIMUV3#get_acceleration,
|
|
412
|
+
# BrickletIMUV3#get_magnetic_field and BrickletIMUV3#get_angular_velocity return uncalibrated
|
|
413
|
+
# and uncompensated sensor data. All other sensor data getters return no data.
|
|
414
|
+
#
|
|
415
|
+
# Since firmware version 2.0.6 you can also use a fusion mode without magnetometer.
|
|
416
|
+
# In this mode the calculated orientation is relative (with magnetometer it is
|
|
417
|
+
# absolute with respect to the earth). However, the calculation can't be influenced
|
|
418
|
+
# by spurious magnetic fields.
|
|
419
|
+
#
|
|
420
|
+
# Since firmware version 2.0.13 you can also use a fusion mode without fast
|
|
421
|
+
# magnetometer calibration. This mode is the same as the normal fusion mode,
|
|
422
|
+
# but the fast magnetometer calibration is turned off. So to find the orientation
|
|
423
|
+
# the first time will likely take longer, but small magnetic influences might
|
|
424
|
+
# not affect the automatic calibration as much.
|
|
425
|
+
def set_sensor_fusion_mode(mode)
|
|
426
|
+
check_validity
|
|
427
|
+
|
|
428
|
+
send_request FUNCTION_SET_SENSOR_FUSION_MODE, [mode], 'C', 8, ''
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
# Returns the sensor fusion mode as set by BrickletIMUV3#set_sensor_fusion_mode.
|
|
432
|
+
def get_sensor_fusion_mode
|
|
433
|
+
check_validity
|
|
434
|
+
|
|
435
|
+
send_request FUNCTION_GET_SENSOR_FUSION_MODE, [], '', 9, 'C'
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# The period is the period with which the CALLBACK_ACCELERATION callback
|
|
439
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
440
|
+
#
|
|
441
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
442
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
443
|
+
# period, the callback is triggered immediately on change.
|
|
444
|
+
#
|
|
445
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
446
|
+
# independent of the value.
|
|
447
|
+
def set_acceleration_callback_configuration(period, value_has_to_change)
|
|
448
|
+
check_validity
|
|
449
|
+
|
|
450
|
+
send_request FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_acceleration_callback_configuration.
|
|
454
|
+
def get_acceleration_callback_configuration
|
|
455
|
+
check_validity
|
|
456
|
+
|
|
457
|
+
send_request FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
# The period is the period with which the CALLBACK_MAGNETIC_FIELD callback
|
|
461
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
462
|
+
#
|
|
463
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
464
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
465
|
+
# period, the callback is triggered immediately on change.
|
|
466
|
+
#
|
|
467
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
468
|
+
# independent of the value.
|
|
469
|
+
def set_magnetic_field_callback_configuration(period, value_has_to_change)
|
|
470
|
+
check_validity
|
|
471
|
+
|
|
472
|
+
send_request FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_magnetic_field_callback_configuration.
|
|
476
|
+
def get_magnetic_field_callback_configuration
|
|
477
|
+
check_validity
|
|
478
|
+
|
|
479
|
+
send_request FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
# The period is the period with which the CALLBACK_ANGULAR_VELOCITY callback
|
|
483
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
484
|
+
#
|
|
485
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
486
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
487
|
+
# period, the callback is triggered immediately on change.
|
|
488
|
+
#
|
|
489
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
490
|
+
# independent of the value.
|
|
491
|
+
def set_angular_velocity_callback_configuration(period, value_has_to_change)
|
|
492
|
+
check_validity
|
|
493
|
+
|
|
494
|
+
send_request FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
495
|
+
end
|
|
496
|
+
|
|
497
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_angular_velocity_callback_configuration.
|
|
498
|
+
def get_angular_velocity_callback_configuration
|
|
499
|
+
check_validity
|
|
500
|
+
|
|
501
|
+
send_request FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
# The period is the period with which the CALLBACK_TEMPERATURE callback
|
|
505
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
506
|
+
#
|
|
507
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
508
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
509
|
+
# period, the callback is triggered immediately on change.
|
|
510
|
+
#
|
|
511
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
512
|
+
# independent of the value.
|
|
513
|
+
def set_temperature_callback_configuration(period, value_has_to_change)
|
|
514
|
+
check_validity
|
|
515
|
+
|
|
516
|
+
send_request FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_temperature_callback_configuration.
|
|
520
|
+
def get_temperature_callback_configuration
|
|
521
|
+
check_validity
|
|
522
|
+
|
|
523
|
+
send_request FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
524
|
+
end
|
|
525
|
+
|
|
526
|
+
# The period is the period with which the CALLBACK_ORIENTATION callback
|
|
527
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
528
|
+
#
|
|
529
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
530
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
531
|
+
# period, the callback is triggered immediately on change.
|
|
532
|
+
#
|
|
533
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
534
|
+
# independent of the value.
|
|
535
|
+
def set_orientation_callback_configuration(period, value_has_to_change)
|
|
536
|
+
check_validity
|
|
537
|
+
|
|
538
|
+
send_request FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_orientation_callback_configuration.
|
|
542
|
+
def get_orientation_callback_configuration
|
|
543
|
+
check_validity
|
|
544
|
+
|
|
545
|
+
send_request FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
546
|
+
end
|
|
547
|
+
|
|
548
|
+
# The period is the period with which the CALLBACK_LINEAR_ACCELERATION callback
|
|
549
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
550
|
+
#
|
|
551
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
552
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
553
|
+
# period, the callback is triggered immediately on change.
|
|
554
|
+
#
|
|
555
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
556
|
+
# independent of the value.
|
|
557
|
+
def set_linear_acceleration_callback_configuration(period, value_has_to_change)
|
|
558
|
+
check_validity
|
|
559
|
+
|
|
560
|
+
send_request FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_linear_acceleration_callback_configuration.
|
|
564
|
+
def get_linear_acceleration_callback_configuration
|
|
565
|
+
check_validity
|
|
566
|
+
|
|
567
|
+
send_request FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
# The period is the period with which the CALLBACK_GRAVITY_VECTOR callback
|
|
571
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
572
|
+
#
|
|
573
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
574
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
575
|
+
# period, the callback is triggered immediately on change.
|
|
576
|
+
#
|
|
577
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
578
|
+
# independent of the value.
|
|
579
|
+
def set_gravity_vector_callback_configuration(period, value_has_to_change)
|
|
580
|
+
check_validity
|
|
581
|
+
|
|
582
|
+
send_request FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
583
|
+
end
|
|
584
|
+
|
|
585
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_gravity_vector_callback_configuration.
|
|
586
|
+
def get_gravity_vector_callback_configuration
|
|
587
|
+
check_validity
|
|
588
|
+
|
|
589
|
+
send_request FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
590
|
+
end
|
|
591
|
+
|
|
592
|
+
# The period is the period with which the CALLBACK_QUATERNION callback
|
|
593
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
594
|
+
#
|
|
595
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
596
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
597
|
+
# period, the callback is triggered immediately on change.
|
|
598
|
+
#
|
|
599
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
600
|
+
# independent of the value.
|
|
601
|
+
def set_quaternion_callback_configuration(period, value_has_to_change)
|
|
602
|
+
check_validity
|
|
603
|
+
|
|
604
|
+
send_request FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_quaternion_callback_configuration.
|
|
608
|
+
def get_quaternion_callback_configuration
|
|
609
|
+
check_validity
|
|
610
|
+
|
|
611
|
+
send_request FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
# The period is the period with which the CALLBACK_ALL_DATA callback
|
|
615
|
+
# is triggered periodically. A value of 0 turns the callback off.
|
|
616
|
+
#
|
|
617
|
+
# If the `value has to change`-parameter is set to true, the callback is only
|
|
618
|
+
# triggered after the value has changed. If the value didn't change within the
|
|
619
|
+
# period, the callback is triggered immediately on change.
|
|
620
|
+
#
|
|
621
|
+
# If it is set to false, the callback is continuously triggered with the period,
|
|
622
|
+
# independent of the value.
|
|
623
|
+
def set_all_data_callback_configuration(period, value_has_to_change)
|
|
624
|
+
check_validity
|
|
625
|
+
|
|
626
|
+
send_request FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
|
|
627
|
+
end
|
|
628
|
+
|
|
629
|
+
# Returns the callback configuration as set by BrickletIMUV3#set_all_data_callback_configuration.
|
|
630
|
+
def get_all_data_callback_configuration
|
|
631
|
+
check_validity
|
|
632
|
+
|
|
633
|
+
send_request FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
|
|
634
|
+
end
|
|
635
|
+
|
|
636
|
+
# Returns the error count for the communication between Brick and Bricklet.
|
|
637
|
+
#
|
|
638
|
+
# The errors are divided into
|
|
639
|
+
#
|
|
640
|
+
# * ACK checksum errors,
|
|
641
|
+
# * message checksum errors,
|
|
642
|
+
# * framing errors and
|
|
643
|
+
# * overflow errors.
|
|
644
|
+
#
|
|
645
|
+
# The errors counts are for errors that occur on the Bricklet side. All
|
|
646
|
+
# Bricks have a similar function that returns the errors on the Brick side.
|
|
647
|
+
def get_spitfp_error_count
|
|
648
|
+
check_validity
|
|
649
|
+
|
|
650
|
+
send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 24, 'L L L L'
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
# Sets the bootloader mode and returns the status after the requested
|
|
654
|
+
# mode change was instigated.
|
|
655
|
+
#
|
|
656
|
+
# You can change from bootloader mode to firmware mode and vice versa. A change
|
|
657
|
+
# from bootloader mode to firmware mode will only take place if the entry function,
|
|
658
|
+
# device identifier and CRC are present and correct.
|
|
659
|
+
#
|
|
660
|
+
# This function is used by Brick Viewer during flashing. It should not be
|
|
661
|
+
# necessary to call it in a normal user program.
|
|
662
|
+
def set_bootloader_mode(mode)
|
|
663
|
+
check_validity
|
|
664
|
+
|
|
665
|
+
send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 9, 'C'
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
# Returns the current bootloader mode, see BrickletIMUV3#set_bootloader_mode.
|
|
669
|
+
def get_bootloader_mode
|
|
670
|
+
check_validity
|
|
671
|
+
|
|
672
|
+
send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 9, 'C'
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
# Sets the firmware pointer for BrickletIMUV3#write_firmware. The pointer has
|
|
676
|
+
# to be increased by chunks of size 64. The data is written to flash
|
|
677
|
+
# every 4 chunks (which equals to one page of size 256).
|
|
678
|
+
#
|
|
679
|
+
# This function is used by Brick Viewer during flashing. It should not be
|
|
680
|
+
# necessary to call it in a normal user program.
|
|
681
|
+
def set_write_firmware_pointer(pointer)
|
|
682
|
+
check_validity
|
|
683
|
+
|
|
684
|
+
send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 8, ''
|
|
685
|
+
end
|
|
686
|
+
|
|
687
|
+
# Writes 64 Bytes of firmware at the position as written by
|
|
688
|
+
# BrickletIMUV3#set_write_firmware_pointer before. The firmware is written
|
|
689
|
+
# to flash every 4 chunks.
|
|
690
|
+
#
|
|
691
|
+
# You can only write firmware in bootloader mode.
|
|
692
|
+
#
|
|
693
|
+
# This function is used by Brick Viewer during flashing. It should not be
|
|
694
|
+
# necessary to call it in a normal user program.
|
|
695
|
+
def write_firmware(data)
|
|
696
|
+
check_validity
|
|
697
|
+
|
|
698
|
+
send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 9, 'C'
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
# Sets the status LED configuration. By default the LED shows
|
|
702
|
+
# communication traffic between Brick and Bricklet, it flickers once
|
|
703
|
+
# for every 10 received data packets.
|
|
704
|
+
#
|
|
705
|
+
# You can also turn the LED permanently on/off or show a heartbeat.
|
|
706
|
+
#
|
|
707
|
+
# If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
|
|
708
|
+
def set_status_led_config(config)
|
|
709
|
+
check_validity
|
|
710
|
+
|
|
711
|
+
send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 8, ''
|
|
712
|
+
end
|
|
713
|
+
|
|
714
|
+
# Returns the configuration as set by BrickletIMUV3#set_status_led_config
|
|
715
|
+
def get_status_led_config
|
|
716
|
+
check_validity
|
|
717
|
+
|
|
718
|
+
send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 9, 'C'
|
|
719
|
+
end
|
|
720
|
+
|
|
721
|
+
# Returns the temperature as measured inside the microcontroller. The
|
|
722
|
+
# value returned is not the ambient temperature!
|
|
723
|
+
#
|
|
724
|
+
# The temperature is only proportional to the real temperature and it has bad
|
|
725
|
+
# accuracy. Practically it is only useful as an indicator for
|
|
726
|
+
# temperature changes.
|
|
727
|
+
def get_chip_temperature
|
|
728
|
+
check_validity
|
|
729
|
+
|
|
730
|
+
send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 10, 's'
|
|
731
|
+
end
|
|
732
|
+
|
|
733
|
+
# Calling this function will reset the Bricklet. All configurations
|
|
734
|
+
# will be lost.
|
|
735
|
+
#
|
|
736
|
+
# After a reset you have to create new device objects,
|
|
737
|
+
# calling functions on the existing ones will result in
|
|
738
|
+
# undefined behavior!
|
|
739
|
+
def reset
|
|
740
|
+
check_validity
|
|
741
|
+
|
|
742
|
+
send_request FUNCTION_RESET, [], '', 8, ''
|
|
743
|
+
end
|
|
744
|
+
|
|
745
|
+
# Writes a new UID into flash. If you want to set a new UID
|
|
746
|
+
# you have to decode the Base58 encoded UID string into an
|
|
747
|
+
# integer first.
|
|
748
|
+
#
|
|
749
|
+
# We recommend that you use Brick Viewer to change the UID.
|
|
750
|
+
def write_uid(uid)
|
|
751
|
+
check_validity
|
|
752
|
+
|
|
753
|
+
send_request FUNCTION_WRITE_UID, [uid], 'L', 8, ''
|
|
754
|
+
end
|
|
755
|
+
|
|
756
|
+
# Returns the current UID as an integer. Encode as
|
|
757
|
+
# Base58 to get the usual string version.
|
|
758
|
+
def read_uid
|
|
759
|
+
check_validity
|
|
760
|
+
|
|
761
|
+
send_request FUNCTION_READ_UID, [], '', 12, 'L'
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
765
|
+
# the position, the hardware and firmware version as well as the
|
|
766
|
+
# device identifier.
|
|
767
|
+
#
|
|
768
|
+
# The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
|
|
769
|
+
# A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
|
|
770
|
+
# position 'z'.
|
|
771
|
+
#
|
|
772
|
+
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
773
|
+
# |device_identifier_constant|
|
|
774
|
+
def get_identity
|
|
775
|
+
send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
|
|
776
|
+
end
|
|
777
|
+
|
|
778
|
+
# Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
|
|
779
|
+
def register_callback(id, &block)
|
|
780
|
+
callback = block
|
|
781
|
+
@registered_callbacks[id] = callback
|
|
782
|
+
end
|
|
783
|
+
end
|
|
784
|
+
end
|