tinkerforge 2.1.17 → 2.1.18
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 +4 -4
- data/lib/tinkerforge/brick_dc.rb +6 -6
- data/lib/tinkerforge/brick_imu.rb +6 -6
- data/lib/tinkerforge/brick_imu_v2.rb +13 -6
- data/lib/tinkerforge/brick_master.rb +6 -6
- data/lib/tinkerforge/brick_red.rb +2 -2
- data/lib/tinkerforge/brick_servo.rb +9 -7
- data/lib/tinkerforge/brick_silent_stepper.rb +13 -13
- data/lib/tinkerforge/brick_stepper.rb +6 -6
- data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
- data/lib/tinkerforge/bricklet_air_quality.rb +514 -0
- data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
- data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_in_v3.rb +5 -5
- data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_out_v3.rb +210 -0
- data/lib/tinkerforge/bricklet_barometer.rb +2 -2
- data/lib/tinkerforge/bricklet_barometer_v2.rb +497 -0
- data/lib/tinkerforge/bricklet_can.rb +2 -2
- data/lib/tinkerforge/bricklet_can_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_co2.rb +2 -2
- data/lib/tinkerforge/bricklet_color.rb +2 -2
- data/lib/tinkerforge/bricklet_current12.rb +2 -2
- data/lib/tinkerforge/bricklet_current25.rb +2 -2
- data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
- data/lib/tinkerforge/bricklet_distance_ir_v2.rb +398 -0
- data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
- data/lib/tinkerforge/bricklet_dmx.rb +7 -5
- data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
- data/lib/tinkerforge/bricklet_dual_button_v2.rb +283 -0
- data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
- data/lib/tinkerforge/bricklet_gps.rb +2 -2
- data/lib/tinkerforge/bricklet_gps_v2.rb +6 -6
- data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
- data/lib/tinkerforge/bricklet_humidity.rb +2 -2
- data/lib/tinkerforge/bricklet_humidity_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +336 -0
- data/lib/tinkerforge/bricklet_industrial_counter.rb +12 -12
- data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +7 -7
- data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +302 -0
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +382 -0
- data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +374 -0
- data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +5 -5
- data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +11 -11
- data/lib/tinkerforge/bricklet_io16.rb +2 -2
- data/lib/tinkerforge/bricklet_io16_v2.rb +418 -0
- data/lib/tinkerforge/bricklet_io4.rb +2 -2
- data/lib/tinkerforge/bricklet_io4_v2.rb +6 -6
- data/lib/tinkerforge/bricklet_isolator.rb +282 -0
- data/lib/tinkerforge/bricklet_joystick.rb +2 -2
- data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
- data/lib/tinkerforge/bricklet_lcd_128x64.rb +486 -0
- data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
- data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
- data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
- data/lib/tinkerforge/bricklet_led_strip_v2.rb +8 -8
- data/lib/tinkerforge/bricklet_line.rb +2 -2
- data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
- data/lib/tinkerforge/bricklet_load_cell_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_moisture.rb +2 -2
- data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
- data/lib/tinkerforge/bricklet_motion_detector_v2.rb +6 -6
- data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +5 -5
- data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
- data/lib/tinkerforge/bricklet_nfc.rb +6 -6
- data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
- data/lib/tinkerforge/bricklet_oled_128x64.rb +2 -2
- data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +387 -0
- data/lib/tinkerforge/bricklet_oled_64x48.rb +2 -2
- data/lib/tinkerforge/bricklet_one_wire.rb +305 -0
- data/lib/tinkerforge/bricklet_outdoor_weather.rb +5 -5
- data/lib/tinkerforge/bricklet_particulate_matter.rb +5 -5
- data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
- data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
- data/lib/tinkerforge/bricklet_ptc.rb +2 -2
- data/lib/tinkerforge/bricklet_ptc_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
- data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
- data/lib/tinkerforge/bricklet_remote_switch_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
- data/lib/tinkerforge/bricklet_rgb_led_button.rb +5 -5
- data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +5 -5
- data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
- data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_rs232.rb +2 -2
- data/lib/tinkerforge/bricklet_rs232_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_rs485.rb +5 -5
- data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
- data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
- data/lib/tinkerforge/bricklet_sound_pressure_level.rb +9 -9
- data/lib/tinkerforge/bricklet_temperature.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_temperature_v2.rb +278 -0
- data/lib/tinkerforge/bricklet_thermal_imaging.rb +5 -5
- data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
- data/lib/tinkerforge/bricklet_thermocouple_v2.rb +5 -5
- data/lib/tinkerforge/bricklet_tilt.rb +2 -2
- data/lib/tinkerforge/bricklet_uv_light.rb +6 -5
- data/lib/tinkerforge/bricklet_uv_light_v2.rb +430 -0
- data/lib/tinkerforge/bricklet_voltage.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage_current_v2.rb +5 -5
- data/lib/tinkerforge/version.rb +1 -1
- metadata +18 -2
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# -*- ruby encoding: utf-8 -*-
|
|
2
|
+
#############################################################
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
|
+
# #
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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
|
+
# Two tactile buttons with built-in blue LEDs
|
|
14
|
+
class BrickletDualButtonV2 < Device
|
|
15
|
+
DEVICE_IDENTIFIER = 2119 # :nodoc:
|
|
16
|
+
DEVICE_DISPLAY_NAME = 'Dual Button Bricklet 2.0' # :nodoc:
|
|
17
|
+
|
|
18
|
+
# This callback is called whenever a button is pressed.
|
|
19
|
+
#
|
|
20
|
+
# Possible states for buttons are:
|
|
21
|
+
#
|
|
22
|
+
# * 0 = pressed
|
|
23
|
+
# * 1 = released
|
|
24
|
+
#
|
|
25
|
+
# Possible states for LEDs are:
|
|
26
|
+
#
|
|
27
|
+
# * 0 = AutoToggleOn: Auto toggle enabled and LED on.
|
|
28
|
+
# * 1 = AutoToggleOff: Auto toggle enabled and LED off.
|
|
29
|
+
# * 2 = On: LED on (auto toggle is disabled).
|
|
30
|
+
# * 3 = Off: LED off (auto toggle is disabled).
|
|
31
|
+
#
|
|
32
|
+
# This callback can be enabled with BrickletDualButtonV2#set_state_changed_callback_configuration.
|
|
33
|
+
CALLBACK_STATE_CHANGED = 4
|
|
34
|
+
|
|
35
|
+
FUNCTION_SET_LED_STATE = 1 # :nodoc:
|
|
36
|
+
FUNCTION_GET_LED_STATE = 2 # :nodoc:
|
|
37
|
+
FUNCTION_GET_BUTTON_STATE = 3 # :nodoc:
|
|
38
|
+
FUNCTION_SET_SELECTED_LED_STATE = 5 # :nodoc:
|
|
39
|
+
FUNCTION_SET_STATE_CHANGED_CALLBACK_CONFIGURATION = 6 # :nodoc:
|
|
40
|
+
FUNCTION_GET_STATE_CHANGED_CALLBACK_CONFIGURATION = 7 # :nodoc:
|
|
41
|
+
FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
|
|
42
|
+
FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
|
|
43
|
+
FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
|
|
44
|
+
FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
|
|
45
|
+
FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
|
|
46
|
+
FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
|
|
47
|
+
FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
|
|
48
|
+
FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
|
|
49
|
+
FUNCTION_RESET = 243 # :nodoc:
|
|
50
|
+
FUNCTION_WRITE_UID = 248 # :nodoc:
|
|
51
|
+
FUNCTION_READ_UID = 249 # :nodoc:
|
|
52
|
+
FUNCTION_GET_IDENTITY = 255 # :nodoc:
|
|
53
|
+
|
|
54
|
+
LED_STATE_AUTO_TOGGLE_ON = 0 # :nodoc:
|
|
55
|
+
LED_STATE_AUTO_TOGGLE_OFF = 1 # :nodoc:
|
|
56
|
+
LED_STATE_ON = 2 # :nodoc:
|
|
57
|
+
LED_STATE_OFF = 3 # :nodoc:
|
|
58
|
+
BUTTON_STATE_PRESSED = 0 # :nodoc:
|
|
59
|
+
BUTTON_STATE_RELEASED = 1 # :nodoc:
|
|
60
|
+
LED_LEFT = 0 # :nodoc:
|
|
61
|
+
LED_RIGHT = 1 # :nodoc:
|
|
62
|
+
BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
|
|
63
|
+
BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
|
|
64
|
+
BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
|
|
65
|
+
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
|
|
66
|
+
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
|
|
67
|
+
BOOTLOADER_STATUS_OK = 0 # :nodoc:
|
|
68
|
+
BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
|
|
69
|
+
BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
|
|
70
|
+
BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
|
|
71
|
+
BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
|
|
72
|
+
BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
|
|
73
|
+
STATUS_LED_CONFIG_OFF = 0 # :nodoc:
|
|
74
|
+
STATUS_LED_CONFIG_ON = 1 # :nodoc:
|
|
75
|
+
STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
|
|
76
|
+
STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
|
|
77
|
+
|
|
78
|
+
# Creates an object with the unique device ID <tt>uid</tt> and adds it to
|
|
79
|
+
# the IP Connection <tt>ipcon</tt>.
|
|
80
|
+
def initialize(uid, ipcon)
|
|
81
|
+
super uid, ipcon
|
|
82
|
+
|
|
83
|
+
@api_version = [2, 0, 0]
|
|
84
|
+
|
|
85
|
+
@response_expected[FUNCTION_SET_LED_STATE] = RESPONSE_EXPECTED_FALSE
|
|
86
|
+
@response_expected[FUNCTION_GET_LED_STATE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
87
|
+
@response_expected[FUNCTION_GET_BUTTON_STATE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
88
|
+
@response_expected[FUNCTION_SET_SELECTED_LED_STATE] = RESPONSE_EXPECTED_FALSE
|
|
89
|
+
@response_expected[FUNCTION_SET_STATE_CHANGED_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
|
|
90
|
+
@response_expected[FUNCTION_GET_STATE_CHANGED_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
91
|
+
@response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
92
|
+
@response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
93
|
+
@response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
94
|
+
@response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
|
|
95
|
+
@response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
96
|
+
@response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
|
|
97
|
+
@response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
98
|
+
@response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
99
|
+
@response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
|
|
100
|
+
@response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
|
|
101
|
+
@response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
102
|
+
@response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
|
103
|
+
|
|
104
|
+
@callback_formats[CALLBACK_STATE_CHANGED] = 'C C C C'
|
|
105
|
+
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Sets the state of the LEDs. Possible states are:
|
|
109
|
+
#
|
|
110
|
+
# * 0 = AutoToggleOn: Enables auto toggle with initially enabled LED.
|
|
111
|
+
# * 1 = AutoToggleOff: Activates auto toggle with initially disabled LED.
|
|
112
|
+
# * 2 = On: Enables LED (auto toggle is disabled).
|
|
113
|
+
# * 3 = Off: Disables LED (auto toggle is disabled).
|
|
114
|
+
#
|
|
115
|
+
# In auto toggle mode the LED is toggled automatically at each press of a button.
|
|
116
|
+
#
|
|
117
|
+
# If you just want to set one of the LEDs and don't know the current state
|
|
118
|
+
# of the other LED, you can get the state with BrickletDualButtonV2#get_led_state or you
|
|
119
|
+
# can use BrickletDualButtonV2#set_selected_led_state.
|
|
120
|
+
#
|
|
121
|
+
# The default value is (1, 1).
|
|
122
|
+
def set_led_state(led_l, led_r)
|
|
123
|
+
send_request FUNCTION_SET_LED_STATE, [led_l, led_r], 'C C', 0, ''
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Returns the current state of the LEDs, as set by BrickletDualButtonV2#set_led_state.
|
|
127
|
+
def get_led_state
|
|
128
|
+
send_request FUNCTION_GET_LED_STATE, [], '', 2, 'C C'
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Returns the current state for both buttons. Possible states are:
|
|
132
|
+
#
|
|
133
|
+
# * 0 = pressed
|
|
134
|
+
# * 1 = released
|
|
135
|
+
def get_button_state
|
|
136
|
+
send_request FUNCTION_GET_BUTTON_STATE, [], '', 2, 'C C'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Sets the state of the selected LED (0 or 1).
|
|
140
|
+
#
|
|
141
|
+
# The other LED remains untouched.
|
|
142
|
+
def set_selected_led_state(led, state)
|
|
143
|
+
send_request FUNCTION_SET_SELECTED_LED_STATE, [led, state], 'C C', 0, ''
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# If you enable this callback, the CALLBACK_STATE_CHANGED callback is triggered
|
|
147
|
+
# every time a button is pressed/released
|
|
148
|
+
#
|
|
149
|
+
# By default this callback is disabled.
|
|
150
|
+
def set_state_changed_callback_configuration(enabled)
|
|
151
|
+
send_request FUNCTION_SET_STATE_CHANGED_CALLBACK_CONFIGURATION, [enabled], '?', 0, ''
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Returns the configuration as set by BrickletDualButtonV2#set_state_changed_callback_configuration.
|
|
155
|
+
def get_state_changed_callback_configuration
|
|
156
|
+
send_request FUNCTION_GET_STATE_CHANGED_CALLBACK_CONFIGURATION, [], '', 1, '?'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Returns the error count for the communication between Brick and Bricklet.
|
|
160
|
+
#
|
|
161
|
+
# The errors are divided into
|
|
162
|
+
#
|
|
163
|
+
# * ACK checksum errors,
|
|
164
|
+
# * message checksum errors,
|
|
165
|
+
# * framing errors and
|
|
166
|
+
# * overflow errors.
|
|
167
|
+
#
|
|
168
|
+
# The errors counts are for errors that occur on the Bricklet side. All
|
|
169
|
+
# Bricks have a similar function that returns the errors on the Brick side.
|
|
170
|
+
def get_spitfp_error_count
|
|
171
|
+
send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Sets the bootloader mode and returns the status after the requested
|
|
175
|
+
# mode change was instigated.
|
|
176
|
+
#
|
|
177
|
+
# You can change from bootloader mode to firmware mode and vice versa. A change
|
|
178
|
+
# from bootloader mode to firmware mode will only take place if the entry function,
|
|
179
|
+
# device identifier and CRC are present and correct.
|
|
180
|
+
#
|
|
181
|
+
# This function is used by Brick Viewer during flashing. It should not be
|
|
182
|
+
# necessary to call it in a normal user program.
|
|
183
|
+
def set_bootloader_mode(mode)
|
|
184
|
+
send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Returns the current bootloader mode, see BrickletDualButtonV2#set_bootloader_mode.
|
|
188
|
+
def get_bootloader_mode
|
|
189
|
+
send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Sets the firmware pointer for BrickletDualButtonV2#write_firmware. The pointer has
|
|
193
|
+
# to be increased by chunks of size 64. The data is written to flash
|
|
194
|
+
# every 4 chunks (which equals to one page of size 256).
|
|
195
|
+
#
|
|
196
|
+
# This function is used by Brick Viewer during flashing. It should not be
|
|
197
|
+
# necessary to call it in a normal user program.
|
|
198
|
+
def set_write_firmware_pointer(pointer)
|
|
199
|
+
send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Writes 64 Bytes of firmware at the position as written by
|
|
203
|
+
# BrickletDualButtonV2#set_write_firmware_pointer before. The firmware is written
|
|
204
|
+
# to flash every 4 chunks.
|
|
205
|
+
#
|
|
206
|
+
# You can only write firmware in bootloader mode.
|
|
207
|
+
#
|
|
208
|
+
# This function is used by Brick Viewer during flashing. It should not be
|
|
209
|
+
# necessary to call it in a normal user program.
|
|
210
|
+
def write_firmware(data)
|
|
211
|
+
send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Sets the status LED configuration. By default the LED shows
|
|
215
|
+
# communication traffic between Brick and Bricklet, it flickers once
|
|
216
|
+
# for every 10 received data packets.
|
|
217
|
+
#
|
|
218
|
+
# You can also turn the LED permanently on/off or show a heartbeat.
|
|
219
|
+
#
|
|
220
|
+
# If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
|
|
221
|
+
def set_status_led_config(config)
|
|
222
|
+
send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Returns the configuration as set by BrickletDualButtonV2#set_status_led_config
|
|
226
|
+
def get_status_led_config
|
|
227
|
+
send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Returns the temperature in °C as measured inside the microcontroller. The
|
|
231
|
+
# value returned is not the ambient temperature!
|
|
232
|
+
#
|
|
233
|
+
# The temperature is only proportional to the real temperature and it has bad
|
|
234
|
+
# accuracy. Practically it is only useful as an indicator for
|
|
235
|
+
# temperature changes.
|
|
236
|
+
def get_chip_temperature
|
|
237
|
+
send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Calling this function will reset the Bricklet. All configurations
|
|
241
|
+
# will be lost.
|
|
242
|
+
#
|
|
243
|
+
# After a reset you have to create new device objects,
|
|
244
|
+
# calling functions on the existing ones will result in
|
|
245
|
+
# undefined behavior!
|
|
246
|
+
def reset
|
|
247
|
+
send_request FUNCTION_RESET, [], '', 0, ''
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Writes a new UID into flash. If you want to set a new UID
|
|
251
|
+
# you have to decode the Base58 encoded UID string into an
|
|
252
|
+
# integer first.
|
|
253
|
+
#
|
|
254
|
+
# We recommend that you use Brick Viewer to change the UID.
|
|
255
|
+
def write_uid(uid)
|
|
256
|
+
send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Returns the current UID as an integer. Encode as
|
|
260
|
+
# Base58 to get the usual string version.
|
|
261
|
+
def read_uid
|
|
262
|
+
send_request FUNCTION_READ_UID, [], '', 4, 'L'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
266
|
+
# the position, the hardware and firmware version as well as the
|
|
267
|
+
# device identifier.
|
|
268
|
+
#
|
|
269
|
+
# The position can be 'a', 'b', 'c' or 'd'.
|
|
270
|
+
#
|
|
271
|
+
# The device identifier numbers can be found :ref:`here <device_identifier>`.
|
|
272
|
+
# |device_identifier_constant|
|
|
273
|
+
def get_identity
|
|
274
|
+
send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
|
|
278
|
+
def register_callback(id, &block)
|
|
279
|
+
callback = block
|
|
280
|
+
@registered_callbacks[id] = callback
|
|
281
|
+
end
|
|
282
|
+
end
|
|
283
|
+
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2018-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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 #
|
|
@@ -381,7 +381,7 @@ module Tinkerforge
|
|
|
381
381
|
send_request FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD, [], '', 4, 'L'
|
|
382
382
|
end
|
|
383
383
|
|
|
384
|
-
# If `SBAS <https://en.wikipedia.org/wiki/GNSS_augmentation#Satellite-based_augmentation_system>`__ is enabled,
|
|
384
|
+
# If `SBAS <https://en.wikipedia.org/wiki/GNSS_augmentation#Satellite-based_augmentation_system>`__ is enabled,
|
|
385
385
|
# the position accuracy increases (if SBAS satellites are in view),
|
|
386
386
|
# but the update rate is limited to 5Hz. With SBAS disabled the update rate is increased to 10Hz.
|
|
387
387
|
#
|
|
@@ -403,9 +403,9 @@ module Tinkerforge
|
|
|
403
403
|
#
|
|
404
404
|
# The errors are divided into
|
|
405
405
|
#
|
|
406
|
-
# *
|
|
406
|
+
# * ACK checksum errors,
|
|
407
407
|
# * message checksum errors,
|
|
408
|
-
# *
|
|
408
|
+
# * framing errors and
|
|
409
409
|
# * overflow errors.
|
|
410
410
|
#
|
|
411
411
|
# The errors counts are for errors that occur on the Bricklet side. All
|
|
@@ -419,7 +419,7 @@ module Tinkerforge
|
|
|
419
419
|
#
|
|
420
420
|
# You can change from bootloader mode to firmware mode and vice versa. A change
|
|
421
421
|
# from bootloader mode to firmware mode will only take place if the entry function,
|
|
422
|
-
# device identifier
|
|
422
|
+
# device identifier and CRC are present and correct.
|
|
423
423
|
#
|
|
424
424
|
# This function is used by Brick Viewer during flashing. It should not be
|
|
425
425
|
# necessary to call it in a normal user program.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2018-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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 #
|
|
@@ -243,9 +243,9 @@ module Tinkerforge
|
|
|
243
243
|
#
|
|
244
244
|
# The errors are divided into
|
|
245
245
|
#
|
|
246
|
-
# *
|
|
246
|
+
# * ACK checksum errors,
|
|
247
247
|
# * message checksum errors,
|
|
248
|
-
# *
|
|
248
|
+
# * framing errors and
|
|
249
249
|
# * overflow errors.
|
|
250
250
|
#
|
|
251
251
|
# The errors counts are for errors that occur on the Bricklet side. All
|
|
@@ -259,7 +259,7 @@ module Tinkerforge
|
|
|
259
259
|
#
|
|
260
260
|
# You can change from bootloader mode to firmware mode and vice versa. A change
|
|
261
261
|
# from bootloader mode to firmware mode will only take place if the entry function,
|
|
262
|
-
# device identifier
|
|
262
|
+
# device identifier and CRC are present and correct.
|
|
263
263
|
#
|
|
264
264
|
# This function is used by Brick Viewer during flashing. It should not be
|
|
265
265
|
# necessary to call it in a normal user program.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
|
2
2
|
#############################################################
|
|
3
|
-
# This file was automatically generated on 2018-
|
|
3
|
+
# This file was automatically generated on 2018-09-28. #
|
|
4
4
|
# #
|
|
5
|
-
# Ruby Bindings Version 2.1.
|
|
5
|
+
# Ruby Bindings Version 2.1.18 #
|
|
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 #
|