tinkerforge 2.1.11 → 2.1.12
Sign up to get free protection for your applications and to get access to all the features.
- 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 #
|
@@ -19,15 +19,15 @@ module Tinkerforge
|
|
19
19
|
# BrickletCurrent12#set_current_callback_period. The parameter is the current of the
|
20
20
|
# sensor.
|
21
21
|
#
|
22
|
-
# CALLBACK_CURRENT is only triggered if the current has changed since
|
23
|
-
# last triggering.
|
22
|
+
# The CALLBACK_CURRENT callback is only triggered if the current has changed since
|
23
|
+
# the last triggering.
|
24
24
|
CALLBACK_CURRENT = 15
|
25
25
|
|
26
26
|
# This callback is triggered periodically with the period that is set by
|
27
27
|
# BrickletCurrent12#set_analog_value_callback_period. The parameter is the analog value
|
28
28
|
# of the sensor.
|
29
29
|
#
|
30
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the current has changed since the
|
30
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the current has changed since the
|
31
31
|
# last triggering.
|
32
32
|
CALLBACK_ANALOG_VALUE = 16
|
33
33
|
|
@@ -112,14 +112,14 @@ module Tinkerforge
|
|
112
112
|
# and between -12500mA and 12500mA.
|
113
113
|
#
|
114
114
|
# If you want to get the current periodically, it is recommended to use the
|
115
|
-
# callback
|
115
|
+
# CALLBACK_CURRENT callback and set the period with
|
116
116
|
# BrickletCurrent12#set_current_callback_period.
|
117
117
|
def get_current
|
118
118
|
send_request(FUNCTION_GET_CURRENT, [], '', 2, 's')
|
119
119
|
end
|
120
120
|
|
121
121
|
# Calibrates the 0 value of the sensor. You have to call this function
|
122
|
-
# when there is no current present.
|
122
|
+
# when there is no current present.
|
123
123
|
#
|
124
124
|
# The zero point of the current sensor
|
125
125
|
# is depending on the exact properties of the analog-to-digital converter,
|
@@ -150,8 +150,8 @@ module Tinkerforge
|
|
150
150
|
# unfiltered analog values. The only reason to use BrickletCurrent12#get_analog_value is,
|
151
151
|
# if you need the full resolution of the analog-to-digital converter.
|
152
152
|
#
|
153
|
-
# If you want the analog value periodically, it is recommended to use the
|
154
|
-
# callback
|
153
|
+
# If you want the analog value periodically, it is recommended to use the
|
154
|
+
# CALLBACK_ANALOG_VALUE callback and set the period with
|
155
155
|
# BrickletCurrent12#set_analog_value_callback_period.
|
156
156
|
def get_analog_value
|
157
157
|
send_request(FUNCTION_GET_ANALOG_VALUE, [], '', 2, 'S')
|
@@ -160,8 +160,8 @@ module Tinkerforge
|
|
160
160
|
# Sets the period in ms with which the CALLBACK_CURRENT callback is triggered
|
161
161
|
# periodically. A value of 0 turns the callback off.
|
162
162
|
#
|
163
|
-
# CALLBACK_CURRENT is only triggered if the current has changed since
|
164
|
-
# last triggering.
|
163
|
+
# The CALLBACK_CURRENT callback is only triggered if the current has changed since
|
164
|
+
# the last triggering.
|
165
165
|
#
|
166
166
|
# The default value is 0.
|
167
167
|
def set_current_callback_period(period)
|
@@ -176,8 +176,8 @@ module Tinkerforge
|
|
176
176
|
# Sets the period in ms with which the CALLBACK_ANALOG_VALUE callback is triggered
|
177
177
|
# periodically. A value of 0 turns the callback off.
|
178
178
|
#
|
179
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the analog value has
|
180
|
-
# last triggering.
|
179
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the analog value has
|
180
|
+
# changed since the last triggering.
|
181
181
|
#
|
182
182
|
# The default value is 0.
|
183
183
|
def set_analog_value_callback_period(period)
|
@@ -189,7 +189,7 @@ module Tinkerforge
|
|
189
189
|
send_request(FUNCTION_GET_ANALOG_VALUE_CALLBACK_PERIOD, [], '', 4, 'L')
|
190
190
|
end
|
191
191
|
|
192
|
-
# Sets the thresholds for the CALLBACK_CURRENT_REACHED callback.
|
192
|
+
# Sets the thresholds for the CALLBACK_CURRENT_REACHED callback.
|
193
193
|
#
|
194
194
|
# The following options are possible:
|
195
195
|
#
|
@@ -211,7 +211,7 @@ module Tinkerforge
|
|
211
211
|
send_request(FUNCTION_GET_CURRENT_CALLBACK_THRESHOLD, [], '', 5, 'k s s')
|
212
212
|
end
|
213
213
|
|
214
|
-
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
214
|
+
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
215
215
|
#
|
216
216
|
# The following options are possible:
|
217
217
|
#
|
@@ -255,7 +255,7 @@ module Tinkerforge
|
|
255
255
|
send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
|
256
256
|
end
|
257
257
|
|
258
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
258
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
259
259
|
# the position, the hardware and firmware version as well as the
|
260
260
|
# device identifier.
|
261
261
|
#
|
@@ -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
|
# BrickletCurrent25#set_current_callback_period. The parameter is the current of the
|
20
20
|
# sensor.
|
21
21
|
#
|
22
|
-
# CALLBACK_CURRENT is only triggered if the current has changed since the
|
22
|
+
# The CALLBACK_CURRENT callback is only triggered if the current has changed since the
|
23
23
|
# last triggering.
|
24
24
|
CALLBACK_CURRENT = 15
|
25
25
|
|
@@ -27,7 +27,7 @@ module Tinkerforge
|
|
27
27
|
# BrickletCurrent25#set_analog_value_callback_period. The parameter is the analog value of the
|
28
28
|
# sensor.
|
29
29
|
#
|
30
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the current has changed since the
|
30
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the current has changed since the
|
31
31
|
# last triggering.
|
32
32
|
CALLBACK_ANALOG_VALUE = 16
|
33
33
|
|
@@ -112,14 +112,14 @@ module Tinkerforge
|
|
112
112
|
# and between -25000mA and 25000mA.
|
113
113
|
#
|
114
114
|
# If you want to get the current periodically, it is recommended to use the
|
115
|
-
# callback
|
115
|
+
# CALLBACK_CURRENT callback and set the period with
|
116
116
|
# BrickletCurrent25#set_current_callback_period.
|
117
117
|
def get_current
|
118
118
|
send_request(FUNCTION_GET_CURRENT, [], '', 2, 's')
|
119
119
|
end
|
120
120
|
|
121
121
|
# Calibrates the 0 value of the sensor. You have to call this function
|
122
|
-
# when there is no current present.
|
122
|
+
# when there is no current present.
|
123
123
|
#
|
124
124
|
# The zero point of the current sensor
|
125
125
|
# is depending on the exact properties of the analog-to-digital converter,
|
@@ -150,8 +150,8 @@ module Tinkerforge
|
|
150
150
|
# unfiltered analog values. The only reason to use BrickletCurrent25#get_analog_value is,
|
151
151
|
# if you need the full resolution of the analog-to-digital converter.
|
152
152
|
#
|
153
|
-
# If you want the analog value periodically, it is recommended to use the
|
154
|
-
# callback
|
153
|
+
# If you want the analog value periodically, it is recommended to use the
|
154
|
+
# CALLBACK_ANALOG_VALUE callback and set the period with
|
155
155
|
# BrickletCurrent25#set_analog_value_callback_period.
|
156
156
|
def get_analog_value
|
157
157
|
send_request(FUNCTION_GET_ANALOG_VALUE, [], '', 2, 'S')
|
@@ -160,8 +160,8 @@ module Tinkerforge
|
|
160
160
|
# Sets the period in ms with which the CALLBACK_CURRENT callback is triggered
|
161
161
|
# periodically. A value of 0 turns the callback off.
|
162
162
|
#
|
163
|
-
# CALLBACK_CURRENT is only triggered if the current has changed since
|
164
|
-
# last triggering.
|
163
|
+
# The CALLBACK_CURRENT callback is only triggered if the current has changed since
|
164
|
+
# the last triggering.
|
165
165
|
#
|
166
166
|
# The default value is 0.
|
167
167
|
def set_current_callback_period(period)
|
@@ -176,8 +176,8 @@ module Tinkerforge
|
|
176
176
|
# Sets the period in ms with which the CALLBACK_ANALOG_VALUE callback is triggered
|
177
177
|
# periodically. A value of 0 turns the callback off.
|
178
178
|
#
|
179
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the analog value has
|
180
|
-
# last triggering.
|
179
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the analog value has
|
180
|
+
# changed since the last triggering.
|
181
181
|
#
|
182
182
|
# The default value is 0.
|
183
183
|
def set_analog_value_callback_period(period)
|
@@ -189,7 +189,7 @@ module Tinkerforge
|
|
189
189
|
send_request(FUNCTION_GET_ANALOG_VALUE_CALLBACK_PERIOD, [], '', 4, 'L')
|
190
190
|
end
|
191
191
|
|
192
|
-
# Sets the thresholds for the CALLBACK_CURRENT_REACHED callback.
|
192
|
+
# Sets the thresholds for the CALLBACK_CURRENT_REACHED callback.
|
193
193
|
#
|
194
194
|
# The following options are possible:
|
195
195
|
#
|
@@ -211,7 +211,7 @@ module Tinkerforge
|
|
211
211
|
send_request(FUNCTION_GET_CURRENT_CALLBACK_THRESHOLD, [], '', 5, 'k s s')
|
212
212
|
end
|
213
213
|
|
214
|
-
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
214
|
+
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
215
215
|
#
|
216
216
|
# The following options are possible:
|
217
217
|
#
|
@@ -255,7 +255,7 @@ module Tinkerforge
|
|
255
255
|
send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
|
256
256
|
end
|
257
257
|
|
258
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
258
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
259
259
|
# the position, the hardware and firmware version as well as the
|
260
260
|
# device identifier.
|
261
261
|
#
|
@@ -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
|
# BrickletDistanceIR#set_distance_callback_period. The parameter is the distance of the
|
20
20
|
# sensor.
|
21
21
|
#
|
22
|
-
# CALLBACK_DISTANCE is only triggered if the distance has changed since the
|
22
|
+
# The CALLBACK_DISTANCE callback is only triggered if the distance has changed since the
|
23
23
|
# last triggering.
|
24
24
|
CALLBACK_DISTANCE = 15
|
25
25
|
|
@@ -27,8 +27,8 @@ module Tinkerforge
|
|
27
27
|
# BrickletDistanceIR#set_analog_value_callback_period. The parameter is the analog value of the
|
28
28
|
# sensor.
|
29
29
|
#
|
30
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the analog value has changed
|
31
|
-
# last triggering.
|
30
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the analog value has changed
|
31
|
+
# since the last triggering.
|
32
32
|
CALLBACK_ANALOG_VALUE = 16
|
33
33
|
|
34
34
|
# This callback is triggered when the threshold as set by
|
@@ -107,7 +107,7 @@ module Tinkerforge
|
|
107
107
|
# selected IR sensor.
|
108
108
|
#
|
109
109
|
# If you want to get the distance periodically, it is recommended to use the
|
110
|
-
# callback
|
110
|
+
# CALLBACK_DISTANCE callback and set the period with
|
111
111
|
# BrickletDistanceIR#set_distance_callback_period.
|
112
112
|
def get_distance
|
113
113
|
send_request(FUNCTION_GET_DISTANCE, [], '', 2, 'S')
|
@@ -122,8 +122,8 @@ module Tinkerforge
|
|
122
122
|
# unfiltered analog values. The only reason to use BrickletDistanceIR#get_analog_value is,
|
123
123
|
# if you need the full resolution of the analog-to-digital converter.
|
124
124
|
#
|
125
|
-
# If you want the analog value periodically, it is recommended to use the
|
126
|
-
# callback
|
125
|
+
# If you want the analog value periodically, it is recommended to use the
|
126
|
+
# CALLBACK_ANALOG_VALUE callback and set the period with
|
127
127
|
# BrickletDistanceIR#set_analog_value_callback_period.
|
128
128
|
def get_analog_value
|
129
129
|
send_request(FUNCTION_GET_ANALOG_VALUE, [], '', 2, 'S')
|
@@ -160,7 +160,7 @@ module Tinkerforge
|
|
160
160
|
# Sets the period in ms with which the CALLBACK_DISTANCE callback is triggered
|
161
161
|
# periodically. A value of 0 turns the callback off.
|
162
162
|
#
|
163
|
-
# CALLBACK_DISTANCE is only triggered if the distance has changed since the
|
163
|
+
# The CALLBACK_DISTANCE callback is only triggered if the distance has changed since the
|
164
164
|
# last triggering.
|
165
165
|
#
|
166
166
|
# The default value is 0.
|
@@ -176,8 +176,8 @@ module Tinkerforge
|
|
176
176
|
# Sets the period in ms with which the CALLBACK_ANALOG_VALUE callback is triggered
|
177
177
|
# periodically. A value of 0 turns the callback off.
|
178
178
|
#
|
179
|
-
# CALLBACK_ANALOG_VALUE is only triggered if the analog value has
|
180
|
-
# last triggering.
|
179
|
+
# The CALLBACK_ANALOG_VALUE callback is only triggered if the analog value has
|
180
|
+
# changed since the last triggering.
|
181
181
|
#
|
182
182
|
# The default value is 0.
|
183
183
|
def set_analog_value_callback_period(period)
|
@@ -189,7 +189,7 @@ module Tinkerforge
|
|
189
189
|
send_request(FUNCTION_GET_ANALOG_VALUE_CALLBACK_PERIOD, [], '', 4, 'L')
|
190
190
|
end
|
191
191
|
|
192
|
-
# Sets the thresholds for the CALLBACK_DISTANCE_REACHED callback.
|
192
|
+
# Sets the thresholds for the CALLBACK_DISTANCE_REACHED callback.
|
193
193
|
#
|
194
194
|
# The following options are possible:
|
195
195
|
#
|
@@ -211,7 +211,7 @@ module Tinkerforge
|
|
211
211
|
send_request(FUNCTION_GET_DISTANCE_CALLBACK_THRESHOLD, [], '', 5, 'k S S')
|
212
212
|
end
|
213
213
|
|
214
|
-
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
214
|
+
# Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
|
215
215
|
#
|
216
216
|
# The following options are possible:
|
217
217
|
#
|
@@ -255,7 +255,7 @@ module Tinkerforge
|
|
255
255
|
send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
|
256
256
|
end
|
257
257
|
|
258
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
258
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
259
259
|
# the position, the hardware and firmware version as well as the
|
260
260
|
# device identifier.
|
261
261
|
#
|
@@ -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,8 +19,8 @@ module Tinkerforge
|
|
19
19
|
# BrickletDistanceUS#set_distance_callback_period. The parameter is the distance value
|
20
20
|
# of the sensor.
|
21
21
|
#
|
22
|
-
# CALLBACK_DISTANCE is only triggered if the distance value has changed
|
23
|
-
# last triggering.
|
22
|
+
# The CALLBACK_DISTANCE callback is only triggered if the distance value has changed
|
23
|
+
# since the last triggering.
|
24
24
|
CALLBACK_DISTANCE = 8
|
25
25
|
|
26
26
|
# This callback is triggered when the threshold as set by
|
@@ -80,7 +80,7 @@ module Tinkerforge
|
|
80
80
|
# non-linear (resolution is bigger at close range).
|
81
81
|
#
|
82
82
|
# If you want to get the distance value periodically, it is recommended to
|
83
|
-
# use the callback
|
83
|
+
# use the CALLBACK_DISTANCE callback and set the period with
|
84
84
|
# BrickletDistanceUS#set_distance_callback_period.
|
85
85
|
def get_distance_value
|
86
86
|
send_request(FUNCTION_GET_DISTANCE_VALUE, [], '', 2, 'S')
|
@@ -89,8 +89,8 @@ module Tinkerforge
|
|
89
89
|
# Sets the period in ms with which the CALLBACK_DISTANCE callback is triggered
|
90
90
|
# periodically. A value of 0 turns the callback off.
|
91
91
|
#
|
92
|
-
# CALLBACK_DISTANCE is only triggered if the distance value has changed
|
93
|
-
# last triggering.
|
92
|
+
# Der CALLBACK_DISTANCE callback is only triggered if the distance value has changed
|
93
|
+
# since the last triggering.
|
94
94
|
#
|
95
95
|
# The default value is 0.
|
96
96
|
def set_distance_callback_period(period)
|
@@ -102,7 +102,7 @@ module Tinkerforge
|
|
102
102
|
send_request(FUNCTION_GET_DISTANCE_CALLBACK_PERIOD, [], '', 4, 'L')
|
103
103
|
end
|
104
104
|
|
105
|
-
# Sets the thresholds for the CALLBACK_DISTANCE_REACHED callback.
|
105
|
+
# Sets the thresholds for the CALLBACK_DISTANCE_REACHED callback.
|
106
106
|
#
|
107
107
|
# The following options are possible:
|
108
108
|
#
|
@@ -162,7 +162,7 @@ module Tinkerforge
|
|
162
162
|
send_request(FUNCTION_GET_MOVING_AVERAGE, [], '', 1, 'C')
|
163
163
|
end
|
164
164
|
|
165
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
165
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
166
166
|
# the position, the hardware and firmware version as well as the
|
167
167
|
# device identifier.
|
168
168
|
#
|
@@ -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 #
|
@@ -15,7 +15,7 @@ module Tinkerforge
|
|
15
15
|
DEVICE_IDENTIFIER = 230 # :nodoc:
|
16
16
|
DEVICE_DISPLAY_NAME = 'Dual Button Bricklet' # :nodoc:
|
17
17
|
|
18
|
-
# This callback is called whenever a button is pressed.
|
18
|
+
# This callback is called whenever a button is pressed.
|
19
19
|
#
|
20
20
|
# Possible states for buttons are:
|
21
21
|
#
|
@@ -93,14 +93,14 @@ module Tinkerforge
|
|
93
93
|
send_request(FUNCTION_GET_BUTTON_STATE, [], '', 2, 'C C')
|
94
94
|
end
|
95
95
|
|
96
|
-
# Sets the state of the selected LED (0 or 1).
|
96
|
+
# Sets the state of the selected LED (0 or 1).
|
97
97
|
#
|
98
98
|
# The other LED remains untouched.
|
99
99
|
def set_selected_led_state(led, state)
|
100
100
|
send_request(FUNCTION_SET_SELECTED_LED_STATE, [led, state], 'C C', 0, '')
|
101
101
|
end
|
102
102
|
|
103
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
103
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
104
104
|
# the position, the hardware and firmware version as well as the
|
105
105
|
# device identifier.
|
106
106
|
#
|
@@ -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 #
|
@@ -15,8 +15,8 @@ module Tinkerforge
|
|
15
15
|
DEVICE_IDENTIFIER = 26 # :nodoc:
|
16
16
|
DEVICE_DISPLAY_NAME = 'Dual Relay Bricklet' # :nodoc:
|
17
17
|
|
18
|
-
# This callback is triggered whenever a monoflop timer reaches 0. The
|
19
|
-
# parameter contain the relay (1 or 2) and the current state of the relay
|
18
|
+
# This callback is triggered whenever a monoflop timer reaches 0. The
|
19
|
+
# parameter contain the relay (1 or 2) and the current state of the relay
|
20
20
|
# (the state after the monoflop).
|
21
21
|
CALLBACK_MONOFLOP_DONE = 5
|
22
22
|
|
@@ -46,7 +46,7 @@ module Tinkerforge
|
|
46
46
|
@callback_formats[CALLBACK_MONOFLOP_DONE] = 'C ?'
|
47
47
|
end
|
48
48
|
|
49
|
-
# Sets the state of the relays, *true* means on and *false* means off.
|
49
|
+
# Sets the state of the relays, *true* means on and *false* means off.
|
50
50
|
# For example: (true, false) turns relay 1 on and relay 2 off.
|
51
51
|
#
|
52
52
|
# If you just want to set one of the relays and don't know the current state
|
@@ -65,24 +65,24 @@ module Tinkerforge
|
|
65
65
|
send_request(FUNCTION_GET_STATE, [], '', 2, '? ?')
|
66
66
|
end
|
67
67
|
|
68
|
-
# The first parameter can be 1 or 2 (relay 1 or relay 2). The second parameter
|
68
|
+
# The first parameter can be 1 or 2 (relay 1 or relay 2). The second parameter
|
69
69
|
# is the desired state of the relay (*true* means on and *false* means off).
|
70
|
-
# The third parameter indicates the time (in ms) that the relay should hold
|
70
|
+
# The third parameter indicates the time (in ms) that the relay should hold
|
71
71
|
# the state.
|
72
72
|
#
|
73
73
|
# If this function is called with the parameters (1, true, 1500):
|
74
74
|
# Relay 1 will turn on and in 1.5s it will turn off again.
|
75
75
|
#
|
76
|
-
# A monoflop can be used as a failsafe mechanism. For example: Lets assume you
|
77
|
-
# have a RS485 bus and a Dual Relay Bricklet connected to one of the slave
|
76
|
+
# A monoflop can be used as a failsafe mechanism. For example: Lets assume you
|
77
|
+
# have a RS485 bus and a Dual Relay Bricklet connected to one of the slave
|
78
78
|
# stacks. You can now call this function every second, with a time parameter
|
79
|
-
# of two seconds. The relay will be on all the time. If now the RS485
|
79
|
+
# of two seconds. The relay will be on all the time. If now the RS485
|
80
80
|
# connection is lost, the relay will turn off in at most two seconds.
|
81
81
|
def set_monoflop(relay, state, time)
|
82
82
|
send_request(FUNCTION_SET_MONOFLOP, [relay, state, time], 'C ? L', 0, '')
|
83
83
|
end
|
84
84
|
|
85
|
-
# Returns (for the given relay) the current state and the time as set by
|
85
|
+
# Returns (for the given relay) the current state and the time as set by
|
86
86
|
# BrickletDualRelay#set_monoflop as well as the remaining time until the state flips.
|
87
87
|
#
|
88
88
|
# If the timer is not running currently, the remaining time will be returned
|
@@ -91,14 +91,14 @@ module Tinkerforge
|
|
91
91
|
send_request(FUNCTION_GET_MONOFLOP, [relay], 'C', 9, '? L L')
|
92
92
|
end
|
93
93
|
|
94
|
-
# Sets the state of the selected relay (1 or 2), *true* means on and *false* means off.
|
94
|
+
# Sets the state of the selected relay (1 or 2), *true* means on and *false* means off.
|
95
95
|
#
|
96
96
|
# The other relay remains untouched.
|
97
97
|
def set_selected_state(relay, state)
|
98
98
|
send_request(FUNCTION_SET_SELECTED_STATE, [relay, state], 'C ?', 0, '')
|
99
99
|
end
|
100
100
|
|
101
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
101
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
102
102
|
# the position, the hardware and firmware version as well as the
|
103
103
|
# device identifier.
|
104
104
|
#
|