tinkerforge 2.1.11 → 2.1.12
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.
- data/lib/tinkerforge/brick_dc.rb +31 -9
- data/lib/tinkerforge/brick_imu.rb +62 -40
- data/lib/tinkerforge/brick_imu_v2.rb +70 -42
- data/lib/tinkerforge/brick_master.rb +47 -23
- data/lib/tinkerforge/brick_red.rb +3 -3
- data/lib/tinkerforge/brick_servo.rb +40 -18
- data/lib/tinkerforge/brick_silent_stepper.rb +829 -0
- data/lib/tinkerforge/brick_stepper.rb +47 -25
- data/lib/tinkerforge/bricklet_accelerometer.rb +11 -11
- data/lib/tinkerforge/bricklet_ambient_light.rb +12 -12
- data/lib/tinkerforge/bricklet_ambient_light_v2.rb +8 -8
- data/lib/tinkerforge/bricklet_analog_in.rb +18 -18
- data/lib/tinkerforge/bricklet_analog_in_v2.rb +15 -15
- data/lib/tinkerforge/bricklet_analog_out.rb +3 -3
- data/lib/tinkerforge/bricklet_analog_out_v2.rb +3 -3
- data/lib/tinkerforge/bricklet_barometer.rb +19 -19
- data/lib/tinkerforge/bricklet_can.rb +20 -7
- data/lib/tinkerforge/bricklet_co2.rb +14 -14
- data/lib/tinkerforge/bricklet_color.rb +19 -19
- data/lib/tinkerforge/bricklet_current12.rb +16 -16
- data/lib/tinkerforge/bricklet_current25.rb +15 -15
- data/lib/tinkerforge/bricklet_distance_ir.rb +14 -14
- data/lib/tinkerforge/bricklet_distance_us.rb +9 -9
- data/lib/tinkerforge/bricklet_dual_button.rb +5 -5
- data/lib/tinkerforge/bricklet_dual_relay.rb +13 -13
- data/lib/tinkerforge/bricklet_dust_detector.rb +11 -11
- data/lib/tinkerforge/bricklet_gps.rb +21 -21
- data/lib/tinkerforge/bricklet_hall_effect.rb +12 -10
- data/lib/tinkerforge/bricklet_humidity.rb +21 -21
- data/lib/tinkerforge/bricklet_industrial_analog_out.rb +3 -3
- data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +4 -4
- data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +4 -4
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +6 -6
- data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +6 -6
- data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +5 -5
- data/lib/tinkerforge/bricklet_io16.rb +5 -5
- data/lib/tinkerforge/bricklet_io4.rb +5 -5
- data/lib/tinkerforge/bricklet_joystick.rb +16 -16
- data/lib/tinkerforge/bricklet_laser_range_finder.rb +99 -30
- data/lib/tinkerforge/bricklet_lcd_16x2.rb +5 -5
- data/lib/tinkerforge/bricklet_lcd_20x4.rb +5 -5
- data/lib/tinkerforge/bricklet_led_strip.rb +3 -3
- data/lib/tinkerforge/bricklet_line.rb +12 -12
- data/lib/tinkerforge/bricklet_linear_poti.rb +21 -21
- data/lib/tinkerforge/bricklet_load_cell.rb +10 -10
- data/lib/tinkerforge/bricklet_moisture.rb +12 -12
- data/lib/tinkerforge/bricklet_motion_detector.rb +5 -5
- data/lib/tinkerforge/bricklet_multi_touch.rb +3 -3
- data/lib/tinkerforge/bricklet_nfc_rfid.rb +20 -20
- data/lib/tinkerforge/bricklet_oled_128x64.rb +7 -7
- data/lib/tinkerforge/bricklet_oled_64x48.rb +6 -6
- data/lib/tinkerforge/bricklet_piezo_buzzer.rb +4 -4
- data/lib/tinkerforge/bricklet_piezo_speaker.rb +5 -5
- data/lib/tinkerforge/bricklet_ptc.rb +21 -21
- data/lib/tinkerforge/bricklet_real_time_clock.rb +7 -7
- data/lib/tinkerforge/bricklet_remote_switch.rb +3 -3
- data/lib/tinkerforge/bricklet_rgb_led.rb +3 -3
- data/lib/tinkerforge/bricklet_rotary_encoder.rb +6 -6
- data/lib/tinkerforge/bricklet_rotary_poti.rb +23 -23
- data/lib/tinkerforge/bricklet_rs232.rb +19 -16
- data/lib/tinkerforge/bricklet_segment_display_4x7.rb +5 -5
- data/lib/tinkerforge/bricklet_solid_state_relay.rb +12 -12
- data/lib/tinkerforge/bricklet_sound_intensity.rb +13 -12
- data/lib/tinkerforge/bricklet_temperature.rb +12 -12
- data/lib/tinkerforge/bricklet_temperature_ir.rb +30 -30
- data/lib/tinkerforge/bricklet_thermocouple.rb +13 -13
- data/lib/tinkerforge/bricklet_tilt.rb +3 -3
- data/lib/tinkerforge/bricklet_uv_light.rb +10 -10
- data/lib/tinkerforge/bricklet_voltage.rb +18 -18
- data/lib/tinkerforge/bricklet_voltage_current.rb +23 -23
- data/lib/tinkerforge/version.rb +1 -1
- metadata +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -61,7 +61,7 @@ module Tinkerforge
|
|
|
61
61
|
@callback_formats[CALLBACK_BUTTON_RELEASED] = 'C'
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
# Writes text to a specific line (0 to 1) with a specific position
|
|
64
|
+
# Writes text to a specific line (0 to 1) with a specific position
|
|
65
65
|
# (0 to 15). The text can have a maximum of 16 characters.
|
|
66
66
|
#
|
|
67
67
|
# For example: (0, 5, "Hello") will write *Hello* in the middle of the
|
|
@@ -98,7 +98,7 @@ module Tinkerforge
|
|
|
98
98
|
|
|
99
99
|
# Configures if the cursor (shown as "_") should be visible and if it
|
|
100
100
|
# should be blinking (shown as a blinking block). The cursor position
|
|
101
|
-
# is one character behind the the last text written with
|
|
101
|
+
# is one character behind the the last text written with
|
|
102
102
|
# BrickletLCD16x2#write_line.
|
|
103
103
|
#
|
|
104
104
|
# The default is (false, false).
|
|
@@ -155,7 +155,7 @@ module Tinkerforge
|
|
|
155
155
|
send_request(FUNCTION_GET_CUSTOM_CHARACTER, [index], 'C', 8, 'C8')
|
|
156
156
|
end
|
|
157
157
|
|
|
158
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
158
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
159
159
|
# the position, the hardware and firmware version as well as the
|
|
160
160
|
# device identifier.
|
|
161
161
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -69,7 +69,7 @@ module Tinkerforge
|
|
|
69
69
|
@callback_formats[CALLBACK_BUTTON_RELEASED] = 'C'
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
# Writes text to a specific line (0 to 3) with a specific position
|
|
72
|
+
# Writes text to a specific line (0 to 3) with a specific position
|
|
73
73
|
# (0 to 19). The text can have a maximum of 20 characters.
|
|
74
74
|
#
|
|
75
75
|
# For example: (0, 7, "Hello") will write *Hello* in the middle of the
|
|
@@ -106,7 +106,7 @@ module Tinkerforge
|
|
|
106
106
|
|
|
107
107
|
# Configures if the cursor (shown as "_") should be visible and if it
|
|
108
108
|
# should be blinking (shown as a blinking block). The cursor position
|
|
109
|
-
# is one character behind the the last text written with
|
|
109
|
+
# is one character behind the the last text written with
|
|
110
110
|
# BrickletLCD20x4#write_line.
|
|
111
111
|
#
|
|
112
112
|
# The default is (*false*, *false*).
|
|
@@ -211,7 +211,7 @@ module Tinkerforge
|
|
|
211
211
|
send_request(FUNCTION_GET_DEFAULT_TEXT_COUNTER, [], '', 4, 'l')
|
|
212
212
|
end
|
|
213
213
|
|
|
214
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
214
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
215
215
|
# the position, the hardware and firmware version as well as the
|
|
216
216
|
# device identifier.
|
|
217
217
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -365,7 +365,7 @@ module Tinkerforge
|
|
|
365
365
|
send_request(FUNCTION_IS_FRAME_RENDERED_CALLBACK_ENABLED, [], '', 1, '?')
|
|
366
366
|
end
|
|
367
367
|
|
|
368
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
368
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
369
369
|
# the position, the hardware and firmware version as well as the
|
|
370
370
|
# device identifier.
|
|
371
371
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -16,11 +16,11 @@ module Tinkerforge
|
|
|
16
16
|
DEVICE_DISPLAY_NAME = 'Line Bricklet' # :nodoc:
|
|
17
17
|
|
|
18
18
|
# This callback is triggered periodically with the period that is set by
|
|
19
|
-
# BrickletLine#set_reflectivity_callback_period. The parameter is the
|
|
20
|
-
# of the sensor.
|
|
19
|
+
# BrickletLine#set_reflectivity_callback_period. The parameter is the
|
|
20
|
+
# reflectivity of the sensor.
|
|
21
21
|
#
|
|
22
|
-
# CALLBACK_REFLECTIVITY is only triggered if the reflectivity has
|
|
23
|
-
# last triggering.
|
|
22
|
+
# The CALLBACK_REFLECTIVITY callback is only triggered if the reflectivity has
|
|
23
|
+
# changed since the last triggering.
|
|
24
24
|
CALLBACK_REFLECTIVITY = 8
|
|
25
25
|
|
|
26
26
|
# This callback is triggered when the threshold as set by
|
|
@@ -74,8 +74,8 @@ module Tinkerforge
|
|
|
74
74
|
# Usually black has a low reflectivity while white has a high
|
|
75
75
|
# reflectivity.
|
|
76
76
|
#
|
|
77
|
-
# If you want to get the reflectivity periodically, it is recommended
|
|
78
|
-
# to use the callback
|
|
77
|
+
# If you want to get the reflectivity periodically, it is recommended
|
|
78
|
+
# to use the CALLBACK_REFLECTIVITY callback and set the period with
|
|
79
79
|
# BrickletLine#set_reflectivity_callback_period.
|
|
80
80
|
def get_reflectivity
|
|
81
81
|
send_request(FUNCTION_GET_REFLECTIVITY, [], '', 2, 'S')
|
|
@@ -84,8 +84,8 @@ module Tinkerforge
|
|
|
84
84
|
# Sets the period in ms with which the CALLBACK_REFLECTIVITY callback is triggered
|
|
85
85
|
# periodically. A value of 0 turns the callback off.
|
|
86
86
|
#
|
|
87
|
-
# CALLBACK_REFLECTIVITY is only triggered if the reflectivity has
|
|
88
|
-
# last triggering.
|
|
87
|
+
# The CALLBACK_REFLECTIVITY callback is only triggered if the reflectivity has
|
|
88
|
+
# changed since the last triggering.
|
|
89
89
|
#
|
|
90
90
|
# The default value is 0.
|
|
91
91
|
def set_reflectivity_callback_period(period)
|
|
@@ -97,7 +97,7 @@ module Tinkerforge
|
|
|
97
97
|
send_request(FUNCTION_GET_REFLECTIVITY_CALLBACK_PERIOD, [], '', 4, 'L')
|
|
98
98
|
end
|
|
99
99
|
|
|
100
|
-
# Sets the thresholds for the CALLBACK_REFLECTIVITY_REACHED callback.
|
|
100
|
+
# Sets the thresholds for the CALLBACK_REFLECTIVITY_REACHED callback.
|
|
101
101
|
#
|
|
102
102
|
# The following options are possible:
|
|
103
103
|
#
|
|
@@ -139,7 +139,7 @@ module Tinkerforge
|
|
|
139
139
|
send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
|
|
140
140
|
end
|
|
141
141
|
|
|
142
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
142
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
143
143
|
# the position, the hardware and firmware version as well as the
|
|
144
144
|
# device identifier.
|
|
145
145
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -16,24 +16,24 @@ module Tinkerforge
|
|
|
16
16
|
DEVICE_DISPLAY_NAME = 'Linear Poti Bricklet' # :nodoc:
|
|
17
17
|
|
|
18
18
|
# This callback is triggered periodically with the period that is set by
|
|
19
|
-
# BrickletLinearPoti#set_position_callback_period. The parameter is the position
|
|
20
|
-
#
|
|
19
|
+
# BrickletLinearPoti#set_position_callback_period. The parameter is the position
|
|
20
|
+
# of the linear potentiometer.
|
|
21
21
|
#
|
|
22
|
-
# CALLBACK_POSITION is only triggered if the position has changed
|
|
23
|
-
# last triggering.
|
|
22
|
+
# The CALLBACK_POSITION callback is only triggered if the position has changed
|
|
23
|
+
# since the last triggering.
|
|
24
24
|
CALLBACK_POSITION = 13
|
|
25
25
|
|
|
26
26
|
# This callback is triggered periodically with the period that is set by
|
|
27
27
|
# BrickletLinearPoti#set_analog_value_callback_period. The parameter is the analog value of the
|
|
28
28
|
# Linear Potentiometer.
|
|
29
29
|
#
|
|
30
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the position has changed
|
|
31
|
-
# last triggering.
|
|
30
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the position has changed
|
|
31
|
+
# since the last triggering.
|
|
32
32
|
CALLBACK_ANALOG_VALUE = 14
|
|
33
33
|
|
|
34
34
|
# This callback is triggered when the threshold as set by
|
|
35
35
|
# BrickletLinearPoti#set_position_callback_threshold is reached.
|
|
36
|
-
# The parameter is the position of the
|
|
36
|
+
# The parameter is the position of the linear potentiometer.
|
|
37
37
|
#
|
|
38
38
|
# If the threshold keeps being reached, the callback is triggered periodically
|
|
39
39
|
# with the period as set by BrickletLinearPoti#set_debounce_period.
|
|
@@ -41,7 +41,7 @@ module Tinkerforge
|
|
|
41
41
|
|
|
42
42
|
# This callback is triggered when the threshold as set by
|
|
43
43
|
# BrickletLinearPoti#set_analog_value_callback_threshold is reached.
|
|
44
|
-
# The parameter is the analog value of the
|
|
44
|
+
# The parameter is the analog value of the linear potentiometer.
|
|
45
45
|
#
|
|
46
46
|
# If the threshold keeps being reached, the callback is triggered periodically
|
|
47
47
|
# with the period as set by BrickletLinearPoti#set_debounce_period.
|
|
@@ -98,11 +98,11 @@ module Tinkerforge
|
|
|
98
98
|
@callback_formats[CALLBACK_ANALOG_VALUE_REACHED] = 'S'
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
# Returns the position of the
|
|
101
|
+
# Returns the position of the linear potentiometer. The value is
|
|
102
102
|
# between 0 (slider down) and 100 (slider up).
|
|
103
103
|
#
|
|
104
104
|
# If you want to get the position periodically, it is recommended to use the
|
|
105
|
-
# callback
|
|
105
|
+
# CALLBACK_POSITION callback and set the period with
|
|
106
106
|
# BrickletLinearPoti#set_position_callback_period.
|
|
107
107
|
def get_position
|
|
108
108
|
send_request(FUNCTION_GET_POSITION, [], '', 2, 'S')
|
|
@@ -117,8 +117,8 @@ module Tinkerforge
|
|
|
117
117
|
# unfiltered analog values. The only reason to use BrickletLinearPoti#get_analog_value is,
|
|
118
118
|
# if you need the full resolution of the analog-to-digital converter.
|
|
119
119
|
#
|
|
120
|
-
# If you want the analog value periodically, it is recommended to use the
|
|
121
|
-
# callback
|
|
120
|
+
# If you want the analog value periodically, it is recommended to use the
|
|
121
|
+
# CALLBACK_ANALOG_VALUE callback and set the period with
|
|
122
122
|
# BrickletLinearPoti#set_analog_value_callback_period.
|
|
123
123
|
def get_analog_value
|
|
124
124
|
send_request(FUNCTION_GET_ANALOG_VALUE, [], '', 2, 'S')
|
|
@@ -127,8 +127,8 @@ module Tinkerforge
|
|
|
127
127
|
# Sets the period in ms with which the CALLBACK_POSITION callback is triggered
|
|
128
128
|
# periodically. A value of 0 turns the callback off.
|
|
129
129
|
#
|
|
130
|
-
# CALLBACK_POSITION is only triggered if the position has changed
|
|
131
|
-
# last triggering.
|
|
130
|
+
# The CALLBACK_POSITION callback is only triggered if the position has changed
|
|
131
|
+
# since the last triggering.
|
|
132
132
|
#
|
|
133
133
|
# The default value is 0.
|
|
134
134
|
def set_position_callback_period(period)
|
|
@@ -143,8 +143,8 @@ module Tinkerforge
|
|
|
143
143
|
# Sets the period in ms with which the CALLBACK_ANALOG_VALUE callback is triggered
|
|
144
144
|
# periodically. A value of 0 turns the callback off.
|
|
145
145
|
#
|
|
146
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the analog value has
|
|
147
|
-
# last triggering.
|
|
146
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the analog value has
|
|
147
|
+
# changed since the last triggering.
|
|
148
148
|
#
|
|
149
149
|
# The default value is 0.
|
|
150
150
|
def set_analog_value_callback_period(period)
|
|
@@ -156,7 +156,7 @@ module Tinkerforge
|
|
|
156
156
|
send_request(FUNCTION_GET_ANALOG_VALUE_CALLBACK_PERIOD, [], '', 4, 'L')
|
|
157
157
|
end
|
|
158
158
|
|
|
159
|
-
# Sets the thresholds for the CALLBACK_POSITION_REACHED callback.
|
|
159
|
+
# Sets the thresholds for the CALLBACK_POSITION_REACHED callback.
|
|
160
160
|
#
|
|
161
161
|
# The following options are possible:
|
|
162
162
|
#
|
|
@@ -178,7 +178,7 @@ module Tinkerforge
|
|
|
178
178
|
send_request(FUNCTION_GET_POSITION_CALLBACK_THRESHOLD, [], '', 5, 'k S S')
|
|
179
179
|
end
|
|
180
180
|
|
|
181
|
-
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
|
181
|
+
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
|
182
182
|
#
|
|
183
183
|
# The following options are possible:
|
|
184
184
|
#
|
|
@@ -222,7 +222,7 @@ module Tinkerforge
|
|
|
222
222
|
send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
|
|
223
223
|
end
|
|
224
224
|
|
|
225
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
225
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
226
226
|
# the position, the hardware and firmware version as well as the
|
|
227
227
|
# device identifier.
|
|
228
228
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -19,7 +19,7 @@ module Tinkerforge
|
|
|
19
19
|
# BrickletLoadCell#set_weight_callback_period. The parameter is the weight
|
|
20
20
|
# as measured by the load cell.
|
|
21
21
|
#
|
|
22
|
-
# CALLBACK_WEIGHT is only triggered if the weight has changed since the
|
|
22
|
+
# The CALLBACK_WEIGHT callback is only triggered if the weight has changed since the
|
|
23
23
|
# last triggering.
|
|
24
24
|
CALLBACK_WEIGHT = 17
|
|
25
25
|
|
|
@@ -93,8 +93,8 @@ module Tinkerforge
|
|
|
93
93
|
|
|
94
94
|
# Returns the currently measured weight in grams.
|
|
95
95
|
#
|
|
96
|
-
# If you want to get the weight periodically, it is recommended
|
|
97
|
-
# to use the callback
|
|
96
|
+
# If you want to get the weight periodically, it is recommended
|
|
97
|
+
# to use the CALLBACK_WEIGHT callback and set the period with
|
|
98
98
|
# BrickletLoadCell#set_weight_callback_period.
|
|
99
99
|
def get_weight
|
|
100
100
|
send_request(FUNCTION_GET_WEIGHT, [], '', 4, 'l')
|
|
@@ -103,7 +103,7 @@ module Tinkerforge
|
|
|
103
103
|
# Sets the period in ms with which the CALLBACK_WEIGHT callback is triggered
|
|
104
104
|
# periodically. A value of 0 turns the callback off.
|
|
105
105
|
#
|
|
106
|
-
# CALLBACK_WEIGHT is only triggered if the weight has changed since the
|
|
106
|
+
# The CALLBACK_WEIGHT callback is only triggered if the weight has changed since the
|
|
107
107
|
# last triggering.
|
|
108
108
|
#
|
|
109
109
|
# The default value is 0.
|
|
@@ -116,7 +116,7 @@ module Tinkerforge
|
|
|
116
116
|
send_request(FUNCTION_GET_WEIGHT_CALLBACK_PERIOD, [], '', 4, 'L')
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
# Sets the thresholds for the CALLBACK_WEIGHT_REACHED callback.
|
|
119
|
+
# Sets the thresholds for the CALLBACK_WEIGHT_REACHED callback.
|
|
120
120
|
#
|
|
121
121
|
# The following options are possible:
|
|
122
122
|
#
|
|
@@ -194,7 +194,7 @@ module Tinkerforge
|
|
|
194
194
|
# To calibrate your Load Cell Bricklet you have to
|
|
195
195
|
#
|
|
196
196
|
# * empty the scale and call this function with 0 and
|
|
197
|
-
# * add a known weight to the scale and call this function with the weight in
|
|
197
|
+
# * add a known weight to the scale and call this function with the weight in
|
|
198
198
|
# grams.
|
|
199
199
|
#
|
|
200
200
|
# The calibration is saved in the EEPROM of the Bricklet and only
|
|
@@ -221,7 +221,7 @@ module Tinkerforge
|
|
|
221
221
|
# ±20mV, ±40mV and ±80mV respectively. The Load Cell Bricklet uses an
|
|
222
222
|
# excitation voltage of 5V and most load cells use an output of 2mV/V. That
|
|
223
223
|
# means the voltage range is ±15mV for most load cells (i.e. gain of 128x
|
|
224
|
-
# is best). If you don't know what all of this means you should keep it at
|
|
224
|
+
# is best). If you don't know what all of this means you should keep it at
|
|
225
225
|
# 128x, it will most likely be correct.
|
|
226
226
|
#
|
|
227
227
|
# The configuration is saved in the EEPROM of the Bricklet and only
|
|
@@ -240,7 +240,7 @@ module Tinkerforge
|
|
|
240
240
|
send_request(FUNCTION_GET_CONFIGURATION, [], '', 2, 'C C')
|
|
241
241
|
end
|
|
242
242
|
|
|
243
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
243
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
244
244
|
# the position, the hardware and firmware version as well as the
|
|
245
245
|
# device identifier.
|
|
246
246
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -16,11 +16,11 @@ module Tinkerforge
|
|
|
16
16
|
DEVICE_DISPLAY_NAME = 'Moisture Bricklet' # :nodoc:
|
|
17
17
|
|
|
18
18
|
# This callback is triggered periodically with the period that is set by
|
|
19
|
-
# BrickletMoisture#set_moisture_callback_period. The parameter is the
|
|
20
|
-
# of the sensor.
|
|
19
|
+
# BrickletMoisture#set_moisture_callback_period. The parameter is the
|
|
20
|
+
# moisture value of the sensor.
|
|
21
21
|
#
|
|
22
|
-
# CALLBACK_MOISTURE is only triggered if the moisture value has changed
|
|
23
|
-
# last triggering.
|
|
22
|
+
# The CALLBACK_MOISTURE callback is only triggered if the moisture value has changed
|
|
23
|
+
# since the last triggering.
|
|
24
24
|
CALLBACK_MOISTURE = 8
|
|
25
25
|
|
|
26
26
|
# This callback is triggered when the threshold as set by
|
|
@@ -76,8 +76,8 @@ module Tinkerforge
|
|
|
76
76
|
# 0 to 4095. A small value corresponds to little moisture, a big
|
|
77
77
|
# value corresponds to much moisture.
|
|
78
78
|
#
|
|
79
|
-
# If you want to get the moisture value periodically, it is recommended
|
|
80
|
-
# to use the callback
|
|
79
|
+
# If you want to get the moisture value periodically, it is recommended
|
|
80
|
+
# to use the CALLBACK_MOISTURE callback and set the period with
|
|
81
81
|
# BrickletMoisture#set_moisture_callback_period.
|
|
82
82
|
def get_moisture_value
|
|
83
83
|
send_request(FUNCTION_GET_MOISTURE_VALUE, [], '', 2, 'S')
|
|
@@ -86,8 +86,8 @@ module Tinkerforge
|
|
|
86
86
|
# Sets the period in ms with which the CALLBACK_MOISTURE callback is triggered
|
|
87
87
|
# periodically. A value of 0 turns the callback off.
|
|
88
88
|
#
|
|
89
|
-
# CALLBACK_MOISTURE is only triggered if the moisture value has changed
|
|
90
|
-
# last triggering.
|
|
89
|
+
# The CALLBACK_MOISTURE callback is only triggered if the moisture value has changed
|
|
90
|
+
# since the last triggering.
|
|
91
91
|
#
|
|
92
92
|
# The default value is 0.
|
|
93
93
|
def set_moisture_callback_period(period)
|
|
@@ -99,7 +99,7 @@ module Tinkerforge
|
|
|
99
99
|
send_request(FUNCTION_GET_MOISTURE_CALLBACK_PERIOD, [], '', 4, 'L')
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
# Sets the thresholds for the CALLBACK_MOISTURE_REACHED callback.
|
|
102
|
+
# Sets the thresholds for the CALLBACK_MOISTURE_REACHED callback.
|
|
103
103
|
#
|
|
104
104
|
# The following options are possible:
|
|
105
105
|
#
|
|
@@ -159,7 +159,7 @@ module Tinkerforge
|
|
|
159
159
|
send_request(FUNCTION_GET_MOVING_AVERAGE, [], '', 1, 'C')
|
|
160
160
|
end
|
|
161
161
|
|
|
162
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
162
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
163
163
|
# the position, the hardware and firmware version as well as the
|
|
164
164
|
# device identifier.
|
|
165
165
|
#
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2017-
|
|
3
|
+
# This file was automatically generated on 2017-04-21. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.12 #
|
|
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 #
|
|
@@ -63,10 +63,10 @@ module Tinkerforge
|
|
|
63
63
|
send_request(FUNCTION_GET_MOTION_DETECTED, [], '', 1, 'C')
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
# Sets the status led configuration.
|
|
66
|
+
# Sets the status led configuration.
|
|
67
67
|
#
|
|
68
68
|
# By default the status LED turns on if a motion is detected and off is no motion
|
|
69
|
-
# is detected.
|
|
69
|
+
# is detected.
|
|
70
70
|
#
|
|
71
71
|
# You can also turn the LED permanently on/off.
|
|
72
72
|
#
|
|
@@ -82,7 +82,7 @@ module Tinkerforge
|
|
|
82
82
|
send_request(FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C')
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
85
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
86
86
|
# the position, the hardware and firmware version as well as the
|
|
87
87
|
# device identifier.
|
|
88
88
|
#
|