tinkerforge 2.1.16 → 2.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinkerforge/brick_dc.rb +3 -3
  3. data/lib/tinkerforge/brick_imu.rb +3 -3
  4. data/lib/tinkerforge/brick_imu_v2.rb +3 -3
  5. data/lib/tinkerforge/brick_master.rb +3 -3
  6. data/lib/tinkerforge/brick_red.rb +2 -2
  7. data/lib/tinkerforge/brick_servo.rb +3 -3
  8. data/lib/tinkerforge/brick_silent_stepper.rb +3 -3
  9. data/lib/tinkerforge/brick_stepper.rb +3 -3
  10. data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
  11. data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
  12. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
  13. data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
  14. data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
  15. data/lib/tinkerforge/bricklet_analog_in_v3.rb +5 -6
  16. data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
  17. data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
  18. data/lib/tinkerforge/bricklet_barometer.rb +2 -2
  19. data/lib/tinkerforge/bricklet_can.rb +3 -3
  20. data/lib/tinkerforge/bricklet_can_v2.rb +770 -0
  21. data/lib/tinkerforge/bricklet_co2.rb +2 -2
  22. data/lib/tinkerforge/bricklet_color.rb +2 -2
  23. data/lib/tinkerforge/bricklet_current12.rb +2 -2
  24. data/lib/tinkerforge/bricklet_current25.rb +2 -2
  25. data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
  26. data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
  27. data/lib/tinkerforge/bricklet_dmx.rb +3 -3
  28. data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
  29. data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
  30. data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
  31. data/lib/tinkerforge/bricklet_gps.rb +2 -2
  32. data/lib/tinkerforge/bricklet_gps_v2.rb +3 -3
  33. data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
  34. data/lib/tinkerforge/bricklet_humidity.rb +2 -2
  35. data/lib/tinkerforge/bricklet_humidity_v2.rb +11 -13
  36. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
  37. data/lib/tinkerforge/bricklet_industrial_counter.rb +445 -0
  38. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
  39. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +342 -0
  40. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
  41. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
  42. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
  43. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +263 -0
  44. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
  45. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +281 -0
  46. data/lib/tinkerforge/bricklet_io16.rb +2 -2
  47. data/lib/tinkerforge/bricklet_io4.rb +2 -2
  48. data/lib/tinkerforge/bricklet_io4_v2.rb +437 -0
  49. data/lib/tinkerforge/bricklet_joystick.rb +2 -2
  50. data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
  51. data/lib/tinkerforge/bricklet_lcd_16x2.rb +3 -3
  52. data/lib/tinkerforge/bricklet_lcd_20x4.rb +3 -3
  53. data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
  54. data/lib/tinkerforge/bricklet_led_strip_v2.rb +493 -0
  55. data/lib/tinkerforge/bricklet_line.rb +2 -2
  56. data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
  57. data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
  58. data/lib/tinkerforge/bricklet_load_cell_v2.rb +354 -0
  59. data/lib/tinkerforge/bricklet_moisture.rb +2 -2
  60. data/lib/tinkerforge/bricklet_motion_detector.rb +3 -3
  61. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +2 -2
  62. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +5 -6
  63. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
  64. data/lib/tinkerforge/bricklet_nfc.rb +39 -3
  65. data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
  66. data/lib/tinkerforge/bricklet_oled_128x64.rb +2 -2
  67. data/lib/tinkerforge/bricklet_oled_64x48.rb +2 -2
  68. data/lib/tinkerforge/bricklet_outdoor_weather.rb +2 -2
  69. data/lib/tinkerforge/bricklet_particulate_matter.rb +320 -0
  70. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
  71. data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
  72. data/lib/tinkerforge/bricklet_ptc.rb +33 -3
  73. data/lib/tinkerforge/bricklet_ptc_v2.rb +433 -0
  74. data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
  75. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +353 -0
  76. data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
  77. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +2 -2
  78. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  79. data/lib/tinkerforge/bricklet_rgb_led_button.rb +2 -2
  80. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +2 -2
  81. data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
  82. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +8 -9
  83. data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
  84. data/lib/tinkerforge/bricklet_rs232.rb +3 -3
  85. data/lib/tinkerforge/bricklet_rs232_v2.rb +421 -0
  86. data/lib/tinkerforge/bricklet_rs485.rb +6 -6
  87. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  88. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  89. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +3 -3
  90. data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
  91. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +420 -0
  92. data/lib/tinkerforge/bricklet_temperature.rb +3 -3
  93. data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
  94. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +13 -15
  95. data/lib/tinkerforge/bricklet_thermal_imaging.rb +2 -2
  96. data/lib/tinkerforge/bricklet_thermocouple.rb +4 -4
  97. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +340 -0
  98. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  99. data/lib/tinkerforge/bricklet_uv_light.rb +2 -2
  100. data/lib/tinkerforge/bricklet_voltage.rb +2 -2
  101. data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
  102. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +453 -0
  103. data/lib/tinkerforge/ip_connection.rb +4 -4
  104. data/lib/tinkerforge/version.rb +1 -1
  105. metadata +17 -2
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-02-28. #
3
+ # This file was automatically generated on 2018-06-08. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.16 #
5
+ # Ruby Bindings Version 2.1.17 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-02-28. #
3
+ # This file was automatically generated on 2018-06-08. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.16 #
5
+ # Ruby Bindings Version 2.1.17 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-02-28. #
3
+ # This file was automatically generated on 2018-06-08. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.16 #
5
+ # Ruby Bindings Version 2.1.17 #
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 #
@@ -0,0 +1,354 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+ #############################################################
3
+ # This file was automatically generated on 2018-06-08. #
4
+ # #
5
+ # Ruby Bindings Version 2.1.17 #
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
+ module Tinkerforge
13
+ # Measures weight with a load cell
14
+ class BrickletLoadCellV2 < Device
15
+ DEVICE_IDENTIFIER = 2104 # :nodoc:
16
+ DEVICE_DISPLAY_NAME = 'Load Cell Bricklet 2.0' # :nodoc:
17
+
18
+ # This callback is triggered periodically according to the configuration set by
19
+ # BrickletLoadCellV2#set_weight_callback_configuration.
20
+ #
21
+ # The parameter is the same as BrickletLoadCellV2#get_weight.
22
+ CALLBACK_WEIGHT = 4
23
+
24
+ FUNCTION_GET_WEIGHT = 1 # :nodoc:
25
+ FUNCTION_SET_WEIGHT_CALLBACK_CONFIGURATION = 2 # :nodoc:
26
+ FUNCTION_GET_WEIGHT_CALLBACK_CONFIGURATION = 3 # :nodoc:
27
+ FUNCTION_SET_MOVING_AVERAGE = 5 # :nodoc:
28
+ FUNCTION_GET_MOVING_AVERAGE = 6 # :nodoc:
29
+ FUNCTION_SET_INFO_LED_CONFIG = 7 # :nodoc:
30
+ FUNCTION_GET_INFO_LED_CONFIG = 8 # :nodoc:
31
+ FUNCTION_CALIBRATE = 9 # :nodoc:
32
+ FUNCTION_TARE = 10 # :nodoc:
33
+ FUNCTION_SET_CONFIGURATION = 11 # :nodoc:
34
+ FUNCTION_GET_CONFIGURATION = 12 # :nodoc:
35
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
36
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
37
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
38
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
39
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
40
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
41
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
42
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
43
+ FUNCTION_RESET = 243 # :nodoc:
44
+ FUNCTION_WRITE_UID = 248 # :nodoc:
45
+ FUNCTION_READ_UID = 249 # :nodoc:
46
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
47
+
48
+ THRESHOLD_OPTION_OFF = 'x' # :nodoc:
49
+ THRESHOLD_OPTION_OUTSIDE = 'o' # :nodoc:
50
+ THRESHOLD_OPTION_INSIDE = 'i' # :nodoc:
51
+ THRESHOLD_OPTION_SMALLER = '<' # :nodoc:
52
+ THRESHOLD_OPTION_GREATER = '>' # :nodoc:
53
+ INFO_LED_CONFIG_OFF = 0 # :nodoc:
54
+ INFO_LED_CONFIG_ON = 1 # :nodoc:
55
+ INFO_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
56
+ RATE_10HZ = 0 # :nodoc:
57
+ RATE_80HZ = 1 # :nodoc:
58
+ GAIN_128X = 0 # :nodoc:
59
+ GAIN_64X = 1 # :nodoc:
60
+ GAIN_32X = 2 # :nodoc:
61
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
62
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
63
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
64
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
65
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
66
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
67
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
68
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
69
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
70
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
71
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
72
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
73
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
74
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
75
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
76
+
77
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
78
+ # the IP Connection <tt>ipcon</tt>.
79
+ def initialize(uid, ipcon)
80
+ super uid, ipcon
81
+
82
+ @api_version = [2, 0, 0]
83
+
84
+ @response_expected[FUNCTION_GET_WEIGHT] = RESPONSE_EXPECTED_ALWAYS_TRUE
85
+ @response_expected[FUNCTION_SET_WEIGHT_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
86
+ @response_expected[FUNCTION_GET_WEIGHT_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
87
+ @response_expected[FUNCTION_SET_MOVING_AVERAGE] = RESPONSE_EXPECTED_FALSE
88
+ @response_expected[FUNCTION_GET_MOVING_AVERAGE] = RESPONSE_EXPECTED_ALWAYS_TRUE
89
+ @response_expected[FUNCTION_SET_INFO_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
90
+ @response_expected[FUNCTION_GET_INFO_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
91
+ @response_expected[FUNCTION_CALIBRATE] = RESPONSE_EXPECTED_FALSE
92
+ @response_expected[FUNCTION_TARE] = RESPONSE_EXPECTED_FALSE
93
+ @response_expected[FUNCTION_SET_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
94
+ @response_expected[FUNCTION_GET_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
95
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
96
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
97
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
98
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
99
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
100
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
101
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
102
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
103
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
104
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
105
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
106
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
107
+
108
+ @callback_formats[CALLBACK_WEIGHT] = 'l'
109
+
110
+ end
111
+
112
+ # Returns the currently measured weight in grams.
113
+ #
114
+ #
115
+ # If you want to get the value periodically, it is recommended to use the
116
+ # CALLBACK_WEIGHT callback. You can set the callback configuration
117
+ # with BrickletLoadCellV2#set_weight_callback_configuration.
118
+ def get_weight
119
+ send_request FUNCTION_GET_WEIGHT, [], '', 4, 'l'
120
+ end
121
+
122
+ # The period in ms is the period with which the CALLBACK_WEIGHT callback is triggered
123
+ # periodically. A value of 0 turns the callback off.
124
+ #
125
+ # If the `value has to change`-parameter is set to true, the callback is only
126
+ # triggered after the value has changed. If the value didn't change
127
+ # within the period, the callback is triggered immediately on change.
128
+ #
129
+ # If it is set to false, the callback is continuously triggered with the period,
130
+ # independent of the value.
131
+ #
132
+ # It is furthermore possible to constrain the callback with thresholds.
133
+ #
134
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_WEIGHT callback.
135
+ #
136
+ # The following options are possible:
137
+ #
138
+ # "Option", "Description"
139
+ #
140
+ # "'x'", "Threshold is turned off"
141
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
142
+ # "'i'", "Threshold is triggered when the value is *inside* or equal to the min and max values"
143
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
144
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
145
+ #
146
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
147
+ #
148
+ # The default value is (0, false, 'x', 0, 0).
149
+ def set_weight_callback_configuration(period, value_has_to_change, option, min, max)
150
+ send_request FUNCTION_SET_WEIGHT_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k l l', 0, ''
151
+ end
152
+
153
+ # Returns the callback configuration as set by BrickletLoadCellV2#set_weight_callback_configuration.
154
+ def get_weight_callback_configuration
155
+ send_request FUNCTION_GET_WEIGHT_CALLBACK_CONFIGURATION, [], '', 14, 'L ? k l l'
156
+ end
157
+
158
+ # Sets the length of a `moving averaging <https://en.wikipedia.org/wiki/Moving_average>`__
159
+ # for the weight value.
160
+ #
161
+ # Setting the length to 1 will turn the averaging off. With less
162
+ # averaging, there is more noise on the data.
163
+ #
164
+ # The range for the averaging is 1-100.
165
+ #
166
+ # The default value is 4.
167
+ def set_moving_average(average)
168
+ send_request FUNCTION_SET_MOVING_AVERAGE, [average], 'S', 0, ''
169
+ end
170
+
171
+ # Returns the length moving average as set by BrickletLoadCellV2#set_moving_average.
172
+ def get_moving_average
173
+ send_request FUNCTION_GET_MOVING_AVERAGE, [], '', 2, 'S'
174
+ end
175
+
176
+ # Configures the info LED to be either turned off, turned on, or blink in
177
+ # heartbeat mode.
178
+ def set_info_led_config(config)
179
+ send_request FUNCTION_SET_INFO_LED_CONFIG, [config], 'C', 0, ''
180
+ end
181
+
182
+ # Returns the LED configuration as set by BrickletLoadCellV2#set_info_led_config
183
+ def get_info_led_config
184
+ send_request FUNCTION_GET_INFO_LED_CONFIG, [], '', 1, 'C'
185
+ end
186
+
187
+ # To calibrate your Load Cell Bricklet 2.0 you have to
188
+ #
189
+ # * empty the scale and call this function with 0 and
190
+ # * add a known weight to the scale and call this function with the weight in
191
+ # grams.
192
+ #
193
+ # The calibration is saved in the flash of the Bricklet and only
194
+ # needs to be done once.
195
+ #
196
+ # We recommend to use the Brick Viewer for calibration, you don't need
197
+ # to call this function in your source code.
198
+ def calibrate(weight)
199
+ send_request FUNCTION_CALIBRATE, [weight], 'L', 0, ''
200
+ end
201
+
202
+ # Sets the currently measured weight as tare weight.
203
+ def tare
204
+ send_request FUNCTION_TARE, [], '', 0, ''
205
+ end
206
+
207
+ # The measurement rate and gain are configurable.
208
+ #
209
+ # The rate can be either 10Hz or 80Hz. A faster rate will produce more noise.
210
+ # It is additionally possible to add a moving average
211
+ # (see BrickletLoadCellV2#set_moving_average) to the measurements.
212
+ #
213
+ # The gain can be 128x, 64x or 32x. It represents a measurement range of
214
+ # ±20mV, ±40mV and ±80mV respectively. The Load Cell Bricklet uses an
215
+ # excitation voltage of 5V and most load cells use an output of 2mV/V. That
216
+ # means the voltage range is ±15mV for most load cells (i.e. gain of 128x
217
+ # is best). If you don't know what all of this means you should keep it at
218
+ # 128x, it will most likely be correct.
219
+ #
220
+ # The default rate is 10Hz and the default gain is 128x.
221
+ def set_configuration(rate, gain)
222
+ send_request FUNCTION_SET_CONFIGURATION, [rate, gain], 'C C', 0, ''
223
+ end
224
+
225
+ # Returns the configuration as set by BrickletLoadCellV2#set_configuration.
226
+ def get_configuration
227
+ send_request FUNCTION_GET_CONFIGURATION, [], '', 2, 'C C'
228
+ end
229
+
230
+ # Returns the error count for the communication between Brick and Bricklet.
231
+ #
232
+ # The errors are divided into
233
+ #
234
+ # * ack checksum errors,
235
+ # * message checksum errors,
236
+ # * frameing errors and
237
+ # * overflow errors.
238
+ #
239
+ # The errors counts are for errors that occur on the Bricklet side. All
240
+ # Bricks have a similar function that returns the errors on the Brick side.
241
+ def get_spitfp_error_count
242
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
243
+ end
244
+
245
+ # Sets the bootloader mode and returns the status after the requested
246
+ # mode change was instigated.
247
+ #
248
+ # You can change from bootloader mode to firmware mode and vice versa. A change
249
+ # from bootloader mode to firmware mode will only take place if the entry function,
250
+ # device identifier und crc are present and correct.
251
+ #
252
+ # This function is used by Brick Viewer during flashing. It should not be
253
+ # necessary to call it in a normal user program.
254
+ def set_bootloader_mode(mode)
255
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
256
+ end
257
+
258
+ # Returns the current bootloader mode, see BrickletLoadCellV2#set_bootloader_mode.
259
+ def get_bootloader_mode
260
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
261
+ end
262
+
263
+ # Sets the firmware pointer for BrickletLoadCellV2#write_firmware. The pointer has
264
+ # to be increased by chunks of size 64. The data is written to flash
265
+ # every 4 chunks (which equals to one page of size 256).
266
+ #
267
+ # This function is used by Brick Viewer during flashing. It should not be
268
+ # necessary to call it in a normal user program.
269
+ def set_write_firmware_pointer(pointer)
270
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
271
+ end
272
+
273
+ # Writes 64 Bytes of firmware at the position as written by
274
+ # BrickletLoadCellV2#set_write_firmware_pointer before. The firmware is written
275
+ # to flash every 4 chunks.
276
+ #
277
+ # You can only write firmware in bootloader mode.
278
+ #
279
+ # This function is used by Brick Viewer during flashing. It should not be
280
+ # necessary to call it in a normal user program.
281
+ def write_firmware(data)
282
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
283
+ end
284
+
285
+ # Sets the status LED configuration. By default the LED shows
286
+ # communication traffic between Brick and Bricklet, it flickers once
287
+ # for every 10 received data packets.
288
+ #
289
+ # You can also turn the LED permanently on/off or show a heartbeat.
290
+ #
291
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
292
+ def set_status_led_config(config)
293
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
294
+ end
295
+
296
+ # Returns the configuration as set by BrickletLoadCellV2#set_status_led_config
297
+ def get_status_led_config
298
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
299
+ end
300
+
301
+ # Returns the temperature in °C as measured inside the microcontroller. The
302
+ # value returned is not the ambient temperature!
303
+ #
304
+ # The temperature is only proportional to the real temperature and it has bad
305
+ # accuracy. Practically it is only useful as an indicator for
306
+ # temperature changes.
307
+ def get_chip_temperature
308
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
309
+ end
310
+
311
+ # Calling this function will reset the Bricklet. All configurations
312
+ # will be lost.
313
+ #
314
+ # After a reset you have to create new device objects,
315
+ # calling functions on the existing ones will result in
316
+ # undefined behavior!
317
+ def reset
318
+ send_request FUNCTION_RESET, [], '', 0, ''
319
+ end
320
+
321
+ # Writes a new UID into flash. If you want to set a new UID
322
+ # you have to decode the Base58 encoded UID string into an
323
+ # integer first.
324
+ #
325
+ # We recommend that you use Brick Viewer to change the UID.
326
+ def write_uid(uid)
327
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
328
+ end
329
+
330
+ # Returns the current UID as an integer. Encode as
331
+ # Base58 to get the usual string version.
332
+ def read_uid
333
+ send_request FUNCTION_READ_UID, [], '', 4, 'L'
334
+ end
335
+
336
+ # Returns the UID, the UID where the Bricklet is connected to,
337
+ # the position, the hardware and firmware version as well as the
338
+ # device identifier.
339
+ #
340
+ # The position can be 'a', 'b', 'c' or 'd'.
341
+ #
342
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
343
+ # |device_identifier_constant|
344
+ def get_identity
345
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
346
+ end
347
+
348
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
349
+ def register_callback(id, &block)
350
+ callback = block
351
+ @registered_callbacks[id] = callback
352
+ end
353
+ end
354
+ end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-02-28. #
3
+ # This file was automatically generated on 2018-06-08. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.16 #
5
+ # Ruby Bindings Version 2.1.17 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-02-28. #
3
+ # This file was automatically generated on 2018-06-08. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.16 #
5
+ # Ruby Bindings Version 2.1.17 #
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 #
@@ -39,7 +39,7 @@ module Tinkerforge
39
39
  def initialize(uid, ipcon)
40
40
  super uid, ipcon
41
41
 
42
- @api_version = [2, 0, 0]
42
+ @api_version = [2, 0, 1]
43
43
 
44
44
  @response_expected[FUNCTION_GET_MOTION_DETECTED] = RESPONSE_EXPECTED_ALWAYS_TRUE
45
45
  @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-02-28. #
3
+ # This file was automatically generated on 2018-06-08. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.16 #
5
+ # Ruby Bindings Version 2.1.17 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-02-28. #
3
+ # This file was automatically generated on 2018-06-08. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.16 #
5
+ # Ruby Bindings Version 2.1.17 #
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,9 +16,9 @@ module Tinkerforge
16
16
  DEVICE_DISPLAY_NAME = 'Motorized Linear Poti Bricklet' # :nodoc:
17
17
 
18
18
  # This callback is triggered periodically according to the configuration set by
19
- # BrickletMotorizedLinearPoti#set_position_callback_configuration.
19
+ # BrickletMotorizedLinearPoti#set_position_callback_configuration.
20
20
  #
21
- # The `parameter` is the same as BrickletMotorizedLinearPoti#get_position.
21
+ # The parameter is the same as BrickletMotorizedLinearPoti#get_position.
22
22
  CALLBACK_POSITION = 4
23
23
 
24
24
  # This callback is triggered if a new position as set by
@@ -135,11 +135,10 @@ module Tinkerforge
135
135
  #
136
136
  # "'x'", "Threshold is turned off"
137
137
  # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
138
- # "'i'", "Threshold is triggered when the value is *inside* the min and max values"
138
+ # "'i'", "Threshold is triggered when the value is *inside* or equal to the min and max values"
139
139
  # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
140
140
  # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
141
141
  #
142
- #
143
142
  # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
144
143
  #
145
144
  # The default value is (0, false, 'x', 0, 0).