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 #
|
|
@@ -122,7 +122,7 @@ module Tinkerforge
|
|
|
122
122
|
send_request(FUNCTION_GET_ELECTRODE_SENSITIVITY, [], '', 1, 'C')
|
|
123
123
|
end
|
|
124
124
|
|
|
125
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
125
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
126
126
|
# the position, the hardware and firmware version as well as the
|
|
127
127
|
# device identifier.
|
|
128
128
|
#
|
|
@@ -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,9 +69,9 @@ module Tinkerforge
|
|
|
69
69
|
@callback_formats[CALLBACK_STATE_CHANGED] = 'C ?'
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
# To read or write a tag that is in proximity of the NFC/RFID Bricklet you
|
|
72
|
+
# To read or write a tag that is in proximity of the NFC/RFID Bricklet you
|
|
73
73
|
# first have to call this function with the expected tag type as parameter.
|
|
74
|
-
# It is no problem if you don't know the tag type. You can cycle through
|
|
74
|
+
# It is no problem if you don't know the tag type. You can cycle through
|
|
75
75
|
# the available tag types until the tag gives an answer to the request.
|
|
76
76
|
#
|
|
77
77
|
# Current the following tag types are supported:
|
|
@@ -80,14 +80,14 @@ module Tinkerforge
|
|
|
80
80
|
# * NFC Forum Type 1
|
|
81
81
|
# * NFC Forum Type 2
|
|
82
82
|
#
|
|
83
|
-
# After you call BrickletNFCRFID#request_tag_id the NFC/RFID Bricklet will try to read
|
|
83
|
+
# After you call BrickletNFCRFID#request_tag_id the NFC/RFID Bricklet will try to read
|
|
84
84
|
# the tag ID from the tag. After this process is done the state will change.
|
|
85
85
|
# You can either register the CALLBACK_STATE_CHANGED callback or you can poll
|
|
86
86
|
# BrickletNFCRFID#get_state to find out about the state change.
|
|
87
87
|
#
|
|
88
|
-
# If the state changes to *RequestTagIDError* it means that either there was
|
|
89
|
-
# no tag present or that the tag is of an incompatible type. If the state
|
|
90
|
-
# changes to *RequestTagIDReady* it means that a compatible tag was found
|
|
88
|
+
# If the state changes to *RequestTagIDError* it means that either there was
|
|
89
|
+
# no tag present or that the tag is of an incompatible type. If the state
|
|
90
|
+
# changes to *RequestTagIDReady* it means that a compatible tag was found
|
|
91
91
|
# and that the tag ID could be read out. You can now get the tag ID by
|
|
92
92
|
# calling BrickletNFCRFID#get_tag_id.
|
|
93
93
|
#
|
|
@@ -101,7 +101,7 @@ module Tinkerforge
|
|
|
101
101
|
send_request(FUNCTION_REQUEST_TAG_ID, [tag_type], 'C', 0, '')
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
# Returns the tag type, tag ID and the length of the tag ID
|
|
104
|
+
# Returns the tag type, tag ID and the length of the tag ID
|
|
105
105
|
# (4 or 7 bytes are possible length). This function can only be called if the
|
|
106
106
|
# NFC/RFID is currently in one of the *Ready* states. The returned ID
|
|
107
107
|
# is the ID that was saved through the last call of BrickletNFCRFID#request_tag_id.
|
|
@@ -110,7 +110,7 @@ module Tinkerforge
|
|
|
110
110
|
#
|
|
111
111
|
# 1. Call BrickletNFCRFID#request_tag_id
|
|
112
112
|
# 2. Wait for state to change to *RequestTagIDReady* (see BrickletNFCRFID#get_state or
|
|
113
|
-
# CALLBACK_STATE_CHANGED)
|
|
113
|
+
# CALLBACK_STATE_CHANGED callback)
|
|
114
114
|
# 3. Call BrickletNFCRFID#get_tag_id
|
|
115
115
|
def get_tag_id
|
|
116
116
|
send_request(FUNCTION_GET_TAG_ID, [], '', 9, 'C C C7')
|
|
@@ -124,7 +124,7 @@ module Tinkerforge
|
|
|
124
124
|
# The functions of this Bricklet can be called in the *Idle* state and all of
|
|
125
125
|
# the *Ready* and *Error* states.
|
|
126
126
|
#
|
|
127
|
-
# Example: If you call BrickletNFCRFID#request_page, the state will change to
|
|
127
|
+
# Example: If you call BrickletNFCRFID#request_page, the state will change to
|
|
128
128
|
# *RequestPage* until the reading of the page is finished. Then it will change
|
|
129
129
|
# to either *RequestPageReady* if it worked or to *RequestPageError* if it
|
|
130
130
|
# didn't. If the request worked you can get the page by calling BrickletNFCRFID#get_page.
|
|
@@ -145,12 +145,12 @@ module Tinkerforge
|
|
|
145
145
|
#
|
|
146
146
|
# 1. Call BrickletNFCRFID#request_tag_id
|
|
147
147
|
# 2. Wait for state to change to *RequestTagIDReady* (see BrickletNFCRFID#get_state
|
|
148
|
-
# or CALLBACK_STATE_CHANGED)
|
|
148
|
+
# or CALLBACK_STATE_CHANGED callback)
|
|
149
149
|
# 3. If looking for a specific tag then call BrickletNFCRFID#get_tag_id and check if the
|
|
150
150
|
# expected tag was found, if it was not found got back to step 1
|
|
151
151
|
# 4. Call BrickletNFCRFID#authenticate_mifare_classic_page with page and key for the page
|
|
152
152
|
# 5. Wait for state to change to *AuthenticatingMifareClassicPageReady* (see
|
|
153
|
-
# BrickletNFCRFID#get_state or
|
|
153
|
+
# BrickletNFCRFID#get_state or CALLBACK_STATE_CHANGEDcallback)
|
|
154
154
|
# 6. Call BrickletNFCRFID#request_page or BrickletNFCRFID#write_page to read/write page
|
|
155
155
|
def authenticate_mifare_classic_page(page, key_number, key)
|
|
156
156
|
send_request(FUNCTION_AUTHENTICATE_MIFARE_CLASSIC_PAGE, [page, key_number, key], 'S C C6', 0, '')
|
|
@@ -167,12 +167,12 @@ module Tinkerforge
|
|
|
167
167
|
#
|
|
168
168
|
# 1. Call BrickletNFCRFID#request_tag_id
|
|
169
169
|
# 2. Wait for state to change to *RequestTagIDReady* (see BrickletNFCRFID#get_state or
|
|
170
|
-
# CALLBACK_STATE_CHANGED)
|
|
170
|
+
# CALLBACK_STATE_CHANGED callback)
|
|
171
171
|
# 3. If looking for a specific tag then call BrickletNFCRFID#get_tag_id and check if the
|
|
172
172
|
# expected tag was found, if it was not found got back to step 1
|
|
173
173
|
# 4. Call BrickletNFCRFID#write_page with page number and data
|
|
174
174
|
# 5. Wait for state to change to *WritePageReady* (see BrickletNFCRFID#get_state or
|
|
175
|
-
#
|
|
175
|
+
# CALLBACK_STATE_CHANGEDcallback)
|
|
176
176
|
#
|
|
177
177
|
# If you use a Mifare Classic tag you have to authenticate a page before you
|
|
178
178
|
# can write to it. See BrickletNFCRFID#authenticate_mifare_classic_page.
|
|
@@ -180,9 +180,9 @@ module Tinkerforge
|
|
|
180
180
|
send_request(FUNCTION_WRITE_PAGE, [page, data], 'S C16', 0, '')
|
|
181
181
|
end
|
|
182
182
|
|
|
183
|
-
# Reads 16 bytes starting from the given page and stores them into a buffer.
|
|
183
|
+
# Reads 16 bytes starting from the given page and stores them into a buffer.
|
|
184
184
|
# The buffer can then be read out with BrickletNFCRFID#get_page.
|
|
185
|
-
# How many pages are read depends on the tag type. The page sizes are
|
|
185
|
+
# How many pages are read depends on the tag type. The page sizes are
|
|
186
186
|
# as follows:
|
|
187
187
|
#
|
|
188
188
|
# * Mifare Classic page size: 16 byte (one page is read)
|
|
@@ -193,12 +193,12 @@ module Tinkerforge
|
|
|
193
193
|
#
|
|
194
194
|
# 1. Call BrickletNFCRFID#request_tag_id
|
|
195
195
|
# 2. Wait for state to change to *RequestTagIDReady* (see BrickletNFCRFID#get_state
|
|
196
|
-
# or CALLBACK_STATE_CHANGED)
|
|
196
|
+
# or CALLBACK_STATE_CHANGED callback)
|
|
197
197
|
# 3. If looking for a specific tag then call BrickletNFCRFID#get_tag_id and check if the
|
|
198
198
|
# expected tag was found, if it was not found got back to step 1
|
|
199
199
|
# 4. Call BrickletNFCRFID#request_page with page number
|
|
200
200
|
# 5. Wait for state to change to *RequestPageReady* (see BrickletNFCRFID#get_state
|
|
201
|
-
# or CALLBACK_STATE_CHANGED)
|
|
201
|
+
# or CALLBACK_STATE_CHANGED callback)
|
|
202
202
|
# 6. Call BrickletNFCRFID#get_page to retrieve the page from the buffer
|
|
203
203
|
#
|
|
204
204
|
# If you use a Mifare Classic tag you have to authenticate a page before you
|
|
@@ -213,7 +213,7 @@ module Tinkerforge
|
|
|
213
213
|
send_request(FUNCTION_GET_PAGE, [], '', 16, 'C16')
|
|
214
214
|
end
|
|
215
215
|
|
|
216
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
216
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
217
217
|
# the position, the hardware and firmware version as well as the
|
|
218
218
|
# device identifier.
|
|
219
219
|
#
|
|
@@ -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 #
|
|
@@ -55,11 +55,11 @@ module Tinkerforge
|
|
|
55
55
|
# :align: center
|
|
56
56
|
# :target: ../../_images/Bricklets/bricklet_oled_128x64_display.png
|
|
57
57
|
#
|
|
58
|
-
# The LSB (D0) of each data byte is at the top and the MSB (D7) is at the
|
|
58
|
+
# The LSB (D0) of each data byte is at the top and the MSB (D7) is at the
|
|
59
59
|
# bottom of the row.
|
|
60
60
|
#
|
|
61
61
|
# The next call of BrickletOLED128x64#write will write the second half of the row
|
|
62
|
-
# and the next two the second row and so on. To fill the whole display
|
|
62
|
+
# and the next two the second row and so on. To fill the whole display
|
|
63
63
|
# you need to call BrickletOLED128x64#write 16 times.
|
|
64
64
|
def write(data)
|
|
65
65
|
send_request(FUNCTION_WRITE, [data], 'C64', 0, '')
|
|
@@ -93,7 +93,7 @@ module Tinkerforge
|
|
|
93
93
|
send_request(FUNCTION_GET_DISPLAY_CONFIGURATION, [], '', 2, 'C ?')
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
-
# Writes text to a specific line (0 to 7) with a specific position
|
|
96
|
+
# Writes text to a specific line (0 to 7) with a specific position
|
|
97
97
|
# (0 to 25). The text can have a maximum of 26 characters.
|
|
98
98
|
#
|
|
99
99
|
# For example: (1, 10, "Hello") will write *Hello* in the middle of the
|
|
@@ -102,13 +102,13 @@ module Tinkerforge
|
|
|
102
102
|
# You can draw to the display with BrickletOLED128x64#write and then add text to it
|
|
103
103
|
# afterwards.
|
|
104
104
|
#
|
|
105
|
-
# The display uses a special 5x7 pixel charset. You can view the characters
|
|
105
|
+
# The display uses a special 5x7 pixel charset. You can view the characters
|
|
106
106
|
# of the charset in Brick Viewer.
|
|
107
107
|
def write_line(line, position, text)
|
|
108
108
|
send_request(FUNCTION_WRITE_LINE, [line, position, text], 'C C Z26', 0, '')
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
111
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
112
112
|
# the position, the hardware and firmware version as well as the
|
|
113
113
|
# device identifier.
|
|
114
114
|
#
|
|
@@ -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 #
|
|
@@ -55,7 +55,7 @@ module Tinkerforge
|
|
|
55
55
|
# :align: center
|
|
56
56
|
# :target: ../../_images/Bricklets/bricklet_oled_64x48_display.png
|
|
57
57
|
#
|
|
58
|
-
# The LSB (D0) of each data byte is at the top and the MSB (D7) is at the
|
|
58
|
+
# The LSB (D0) of each data byte is at the top and the MSB (D7) is at the
|
|
59
59
|
# bottom of the row.
|
|
60
60
|
#
|
|
61
61
|
# The next call of BrickletOLED64x48#write will write the second row and so on. To
|
|
@@ -92,7 +92,7 @@ module Tinkerforge
|
|
|
92
92
|
send_request(FUNCTION_GET_DISPLAY_CONFIGURATION, [], '', 2, 'C ?')
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
# Writes text to a specific line (0 to 5) with a specific position
|
|
95
|
+
# Writes text to a specific line (0 to 5) with a specific position
|
|
96
96
|
# (0 to 12). The text can have a maximum of 13 characters.
|
|
97
97
|
#
|
|
98
98
|
# For example: (1, 4, "Hello") will write *Hello* in the middle of the
|
|
@@ -101,13 +101,13 @@ module Tinkerforge
|
|
|
101
101
|
# You can draw to the display with BrickletOLED64x48#write and then add text to it
|
|
102
102
|
# afterwards.
|
|
103
103
|
#
|
|
104
|
-
# The display uses a special 5x7 pixel charset. You can view the characters
|
|
104
|
+
# The display uses a special 5x7 pixel charset. You can view the characters
|
|
105
105
|
# of the charset in Brick Viewer.
|
|
106
106
|
def write_line(line, position, text)
|
|
107
107
|
send_request(FUNCTION_WRITE_LINE, [line, position, text], 'C C Z13', 0, '')
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
110
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
111
111
|
# the position, the hardware and firmware version as well as the
|
|
112
112
|
# device identifier.
|
|
113
113
|
#
|
|
@@ -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 #
|
|
@@ -55,7 +55,7 @@ module Tinkerforge
|
|
|
55
55
|
# for *dits*, *dahs* and *pauses*. Every other character is ignored.
|
|
56
56
|
#
|
|
57
57
|
# For example: If you set the string "...---...", the piezo buzzer will beep
|
|
58
|
-
# nine times with the durations "short short short long long long short
|
|
58
|
+
# nine times with the durations "short short short long long long short
|
|
59
59
|
# short short".
|
|
60
60
|
#
|
|
61
61
|
# The maximum string size is 60.
|
|
@@ -63,7 +63,7 @@ module Tinkerforge
|
|
|
63
63
|
send_request(FUNCTION_MORSE_CODE, [morse], 'Z60', 0, '')
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
66
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
67
67
|
# the position, the hardware and firmware version as well as the
|
|
68
68
|
# device identifier.
|
|
69
69
|
#
|
|
@@ -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 #
|
|
@@ -48,7 +48,7 @@ module Tinkerforge
|
|
|
48
48
|
@callback_formats[CALLBACK_MORSE_CODE_FINISHED] = ''
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
# Beeps with the given frequency for the duration in ms. For example:
|
|
51
|
+
# Beeps with the given frequency for the duration in ms. For example:
|
|
52
52
|
# If you set a duration of 1000, with a frequency value of 2000
|
|
53
53
|
# the piezo buzzer will beep for one second with a frequency of
|
|
54
54
|
# approximately 2 kHz.
|
|
@@ -71,7 +71,7 @@ module Tinkerforge
|
|
|
71
71
|
# The second parameter is the frequency (see BrickletPiezoSpeaker#beep).
|
|
72
72
|
#
|
|
73
73
|
# For example: If you set the string "...---...", the piezo buzzer will beep
|
|
74
|
-
# nine times with the durations "short short short long long long short
|
|
74
|
+
# nine times with the durations "short short short long long long short
|
|
75
75
|
# short short".
|
|
76
76
|
#
|
|
77
77
|
# The maximum string size is 60.
|
|
@@ -92,7 +92,7 @@ module Tinkerforge
|
|
|
92
92
|
send_request(FUNCTION_CALIBRATE, [], '', 1, '?')
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
95
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
96
96
|
# the position, the hardware and firmware version as well as the
|
|
97
97
|
# device identifier.
|
|
98
98
|
#
|
|
@@ -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 = 'PTC Bricklet' # :nodoc:
|
|
17
17
|
|
|
18
18
|
# This callback is triggered periodically with the period that is set by
|
|
19
|
-
# BrickletPTC#set_temperature_callback_period. The parameter is the
|
|
20
|
-
# of the connected sensor.
|
|
19
|
+
# BrickletPTC#set_temperature_callback_period. The parameter is the
|
|
20
|
+
# temperature of the connected sensor.
|
|
21
21
|
#
|
|
22
|
-
# CALLBACK_TEMPERATURE is only triggered if the temperature has changed
|
|
23
|
-
# last triggering.
|
|
22
|
+
# The CALLBACK_TEMPERATURE callback is only triggered if the temperature has changed
|
|
23
|
+
# since the last triggering.
|
|
24
24
|
CALLBACK_TEMPERATURE = 13
|
|
25
25
|
|
|
26
26
|
# This callback is triggered when the threshold as set by
|
|
@@ -35,8 +35,8 @@ module Tinkerforge
|
|
|
35
35
|
# BrickletPTC#set_resistance_callback_period. The parameter is the resistance
|
|
36
36
|
# of the connected sensor.
|
|
37
37
|
#
|
|
38
|
-
# CALLBACK_RESISTANCE is only triggered if the resistance has changed
|
|
39
|
-
# last triggering.
|
|
38
|
+
# The CALLBACK_RESISTANCE callback is only triggered if the resistance has changed
|
|
39
|
+
# since the last triggering.
|
|
40
40
|
CALLBACK_RESISTANCE = 15
|
|
41
41
|
|
|
42
42
|
# This callback is triggered when the threshold as set by
|
|
@@ -117,8 +117,8 @@ module Tinkerforge
|
|
|
117
117
|
# has a range of -246 to 849 °C and is given in °C/100,
|
|
118
118
|
# e.g. a value of 4223 means that a temperature of 42.23 °C is measured.
|
|
119
119
|
#
|
|
120
|
-
# If you want to get the temperature periodically, it is recommended
|
|
121
|
-
# to use the callback
|
|
120
|
+
# If you want to get the temperature periodically, it is recommended
|
|
121
|
+
# to use the CALLBACK_TEMPERATURE callback and set the period with
|
|
122
122
|
# BrickletPTC#set_temperature_callback_period.
|
|
123
123
|
def get_temperature
|
|
124
124
|
send_request(FUNCTION_GET_TEMPERATURE, [], '', 4, 'l')
|
|
@@ -131,8 +131,8 @@ module Tinkerforge
|
|
|
131
131
|
# * Pt100: resistance = (value * 390) / 32768
|
|
132
132
|
# * Pt1000: resistance = (value * 3900) / 32768
|
|
133
133
|
#
|
|
134
|
-
# If you want to get the resistance periodically, it is recommended
|
|
135
|
-
# to use the callback
|
|
134
|
+
# If you want to get the resistance periodically, it is recommended
|
|
135
|
+
# to use the CALLBACK_RESISTANCE callback and set the period with
|
|
136
136
|
# BrickletPTC#set_resistance_callback_period.
|
|
137
137
|
def get_resistance
|
|
138
138
|
send_request(FUNCTION_GET_RESISTANCE, [], '', 2, 'S')
|
|
@@ -141,8 +141,8 @@ module Tinkerforge
|
|
|
141
141
|
# Sets the period in ms with which the CALLBACK_TEMPERATURE callback is triggered
|
|
142
142
|
# periodically. A value of 0 turns the callback off.
|
|
143
143
|
#
|
|
144
|
-
# CALLBACK_TEMPERATURE is only triggered if the temperature has
|
|
145
|
-
# last triggering.
|
|
144
|
+
# The CALLBACK_TEMPERATURE callback is only triggered if the temperature has
|
|
145
|
+
# changed since the last triggering.
|
|
146
146
|
#
|
|
147
147
|
# The default value is 0.
|
|
148
148
|
def set_temperature_callback_period(period)
|
|
@@ -157,8 +157,8 @@ module Tinkerforge
|
|
|
157
157
|
# Sets the period in ms with which the CALLBACK_RESISTANCE callback is triggered
|
|
158
158
|
# periodically. A value of 0 turns the callback off.
|
|
159
159
|
#
|
|
160
|
-
# CALLBACK_RESISTANCE is only triggered if the resistance has changed
|
|
161
|
-
# last triggering.
|
|
160
|
+
# The CALLBACK_RESISTANCE callback is only triggered if the resistance has changed
|
|
161
|
+
# since the last triggering.
|
|
162
162
|
#
|
|
163
163
|
# The default value is 0.
|
|
164
164
|
def set_resistance_callback_period(period)
|
|
@@ -170,7 +170,7 @@ module Tinkerforge
|
|
|
170
170
|
send_request(FUNCTION_GET_RESISTANCE_CALLBACK_PERIOD, [], '', 4, 'L')
|
|
171
171
|
end
|
|
172
172
|
|
|
173
|
-
# Sets the thresholds for the CALLBACK_TEMPERATURE_REACHED callback.
|
|
173
|
+
# Sets the thresholds for the CALLBACK_TEMPERATURE_REACHED callback.
|
|
174
174
|
#
|
|
175
175
|
# The following options are possible:
|
|
176
176
|
#
|
|
@@ -192,7 +192,7 @@ module Tinkerforge
|
|
|
192
192
|
send_request(FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 9, 'k l l')
|
|
193
193
|
end
|
|
194
194
|
|
|
195
|
-
# Sets the thresholds for the CALLBACK_RESISTANCE_REACHED callback.
|
|
195
|
+
# Sets the thresholds for the CALLBACK_RESISTANCE_REACHED callback.
|
|
196
196
|
#
|
|
197
197
|
# The following options are possible:
|
|
198
198
|
#
|
|
@@ -246,13 +246,13 @@ module Tinkerforge
|
|
|
246
246
|
send_request(FUNCTION_SET_NOISE_REJECTION_FILTER, [filter], 'C', 0, '')
|
|
247
247
|
end
|
|
248
248
|
|
|
249
|
-
# Returns the noise rejection filter option as set by
|
|
249
|
+
# Returns the noise rejection filter option as set by
|
|
250
250
|
# BrickletPTC#set_noise_rejection_filter
|
|
251
251
|
def get_noise_rejection_filter
|
|
252
252
|
send_request(FUNCTION_GET_NOISE_REJECTION_FILTER, [], '', 1, 'C')
|
|
253
253
|
end
|
|
254
254
|
|
|
255
|
-
# Returns *true* if the sensor is connected correctly.
|
|
255
|
+
# Returns *true* if the sensor is connected correctly.
|
|
256
256
|
#
|
|
257
257
|
# If this function
|
|
258
258
|
# returns *false*, there is either no Pt100 or Pt1000 sensor connected,
|
|
@@ -275,7 +275,7 @@ module Tinkerforge
|
|
|
275
275
|
send_request(FUNCTION_GET_WIRE_MODE, [], '', 1, 'C')
|
|
276
276
|
end
|
|
277
277
|
|
|
278
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
278
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
279
279
|
# the position, the hardware and firmware version as well as the
|
|
280
280
|
# device identifier.
|
|
281
281
|
#
|
|
@@ -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
|
# BrickletRealTimeClock#set_date_time_callback_period. The parameters are the same
|
|
20
20
|
# as for BrickletRealTimeClock#get_date_time and BrickletRealTimeClock#get_timestamp combined.
|
|
21
21
|
#
|
|
22
|
-
# CALLBACK_DATE_TIME is only triggered if the date or time changed
|
|
23
|
-
# last triggering.
|
|
22
|
+
# The CALLBACK_DATE_TIME callback is only triggered if the date or time changed
|
|
23
|
+
# since the last triggering.
|
|
24
24
|
#
|
|
25
25
|
# .. versionadded:: 2.0.1$nbsp;(Plugin)
|
|
26
26
|
CALLBACK_DATE_TIME = 10
|
|
@@ -151,8 +151,8 @@ module Tinkerforge
|
|
|
151
151
|
# Sets the period in ms with which the CALLBACK_DATE_TIME callback is triggered
|
|
152
152
|
# periodically. A value of 0 turns the callback off.
|
|
153
153
|
#
|
|
154
|
-
# CALLBACK_DATE_TIME is only triggered if the date or time changed
|
|
155
|
-
# last triggering.
|
|
154
|
+
# The CALLBACK_DATE_TIME Callback is only triggered if the date or time changed
|
|
155
|
+
# since the last triggering.
|
|
156
156
|
#
|
|
157
157
|
# The default value is 0.
|
|
158
158
|
#
|
|
@@ -205,7 +205,7 @@ module Tinkerforge
|
|
|
205
205
|
send_request(FUNCTION_GET_ALARM, [], '', 10, 'c c c c c c l')
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
-
# Returns the UID, the UID where the Bricklet is connected to,
|
|
208
|
+
# Returns the UID, the UID where the Bricklet is connected to,
|
|
209
209
|
# the position, the hardware and firmware version as well as the
|
|
210
210
|
# device identifier.
|
|
211
211
|
#
|