tinkerforge 2.0.12 → 2.0.13
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 +2 -2
- data/lib/tinkerforge/brick_imu.rb +2 -2
- data/lib/tinkerforge/brick_master.rb +2 -2
- data/lib/tinkerforge/brick_servo.rb +2 -2
- data/lib/tinkerforge/brick_stepper.rb +2 -2
- data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
- data/lib/tinkerforge/bricklet_barometer.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_us.rb +2 -2
- data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
- data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_gps.rb +28 -25
- data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
- data/lib/tinkerforge/bricklet_humidity.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +12 -13
- data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +11 -12
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +11 -12
- data/lib/tinkerforge/bricklet_io16.rb +20 -19
- data/lib/tinkerforge/bricklet_io4.rb +22 -22
- data/lib/tinkerforge/bricklet_joystick.rb +2 -2
- 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 +47 -6
- data/lib/tinkerforge/bricklet_line.rb +2 -2
- data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_moisture.rb +2 -2
- data/lib/tinkerforge/bricklet_motion_detector.rb +7 -3
- data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
- 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_remote_switch.rb +71 -11
- data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
- data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
- data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
- data/lib/tinkerforge/bricklet_tilt.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
- data/lib/tinkerforge/version.rb +1 -1
- metadata +2 -2
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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,8 +55,8 @@ module Tinkerforge
|
|
55
55
|
# is 16 bit long, *true* refers to a closed relay and *false* refers to
|
56
56
|
# an open relay.
|
57
57
|
#
|
58
|
-
# For example: The value
|
59
|
-
#
|
58
|
+
# For example: The value 0b0011 will close the relay of pins 0-1 and open the
|
59
|
+
# other pins.
|
60
60
|
#
|
61
61
|
# If no groups are used (see BrickletIndustrialQuadRelay#set_group), the pins correspond to the
|
62
62
|
# markings on the Quad Relay Bricklet.
|
@@ -82,10 +82,9 @@ module Tinkerforge
|
|
82
82
|
# The third parameter indicates the time (in ms) that the pins should hold
|
83
83
|
# the value.
|
84
84
|
#
|
85
|
-
# If this function is called with the parameters
|
86
|
-
# (
|
87
|
-
#
|
88
|
-
# 3 will close again.
|
85
|
+
# If this function is called with the parameters (9, 1, 1500) or
|
86
|
+
# (0b1001, 0b0001, 1500): Pin 0 will close and pin 3 will open. In 1.5s pin 0
|
87
|
+
# will open and pin 3 will close again.
|
89
88
|
#
|
90
89
|
# A monoflop can be used as a fail-safe mechanism. For example: Lets assume you
|
91
90
|
# have a RS485 bus and a Quad Relay Bricklet connected to one of the slave
|
@@ -115,7 +114,7 @@ module Tinkerforge
|
|
115
114
|
# not be used.
|
116
115
|
#
|
117
116
|
# For example: If you have two Quad Relay Bricklets connected to port A and
|
118
|
-
# port B respectively, you could call with
|
117
|
+
# port B respectively, you could call with ``['a', 'b', 'n', 'n']``.
|
119
118
|
#
|
120
119
|
# Now the pins on the Quad Relay on port A are assigned to 0-3 and the
|
121
120
|
# pins on the Quad Relay on port B are assigned to 4-7. It is now possible
|
@@ -130,7 +129,7 @@ module Tinkerforge
|
|
130
129
|
end
|
131
130
|
|
132
131
|
# Returns a bitmask of ports that are available for grouping. For example the
|
133
|
-
# value 0b0101 means: Port
|
132
|
+
# value 5 or 0b0101 means: Port A and port C are connected to Bricklets that
|
134
133
|
# can be grouped together.
|
135
134
|
def get_available_for_group
|
136
135
|
send_request(FUNCTION_GET_AVAILABLE_FOR_GROUP, [], '', 1, 'C')
|
@@ -140,8 +139,8 @@ module Tinkerforge
|
|
140
139
|
# The bitmask is 16 bit long, *true* refers to a closed relay and
|
141
140
|
# *false* refers to an open relay.
|
142
141
|
#
|
143
|
-
# For example: The values
|
144
|
-
#
|
142
|
+
# For example: The values (3, 1) or (0b0011, 0b0001) will close the relay of
|
143
|
+
# pin 0, open the relay of pin 1 and leave the others untouched.
|
145
144
|
#
|
146
145
|
# If no groups are used (see BrickletIndustrialQuadRelay#set_group), the pins correspond to the
|
147
146
|
# markings on the Quad Relay Bricklet.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 #
|
@@ -22,10 +22,11 @@ module Tinkerforge
|
|
22
22
|
#
|
23
23
|
# For example:
|
24
24
|
#
|
25
|
-
# * (
|
26
|
-
# currently pin 0 is high and pins 1-7 are low.
|
27
|
-
# * (
|
28
|
-
# occurred and currently pin 0 is low and pins 1-7
|
25
|
+
# * ('a', 1, 1) or ('a', 0b00000001, 0b00000001) means that on port A an
|
26
|
+
# interrupt on pin 0 occurred and currently pin 0 is high and pins 1-7 are low.
|
27
|
+
# * ('b', 129, 254) or ('b', 0b10000001, 0b11111110) means that on port B
|
28
|
+
# interrupts on pins 0 and 7 occurred and currently pin 0 is low and pins 1-7
|
29
|
+
# are high.
|
29
30
|
CALLBACK_INTERRUPT = 9
|
30
31
|
|
31
32
|
# This callback is triggered whenever a monoflop timer reaches 0. The
|
@@ -107,7 +108,7 @@ module Tinkerforge
|
|
107
108
|
end
|
108
109
|
|
109
110
|
# Configures the value and direction of a specified port. Possible directions
|
110
|
-
# are
|
111
|
+
# are 'i' and 'o' for input and output.
|
111
112
|
#
|
112
113
|
# If the direction is configured as output, the value is either high or low
|
113
114
|
# (set as *true* or *false*).
|
@@ -117,17 +118,17 @@ module Tinkerforge
|
|
117
118
|
#
|
118
119
|
# For example:
|
119
120
|
#
|
120
|
-
# * (
|
121
|
-
# * (
|
122
|
-
# * (
|
123
|
-
# * (
|
121
|
+
# * ('a', 255, 'i', true) or ('a', 0b11111111, 'i', true) will set all pins of port A as input pull-up.
|
122
|
+
# * ('a', 128, 'i', false) or ('a', 0b10000000, 'i', false) will set pin 7 of port A as input default (floating if nothing is connected).
|
123
|
+
# * ('b', 3, 'o', false) or ('b', 0b00000011, 'o', false) will set pins 0 and 1 of port B as output low.
|
124
|
+
# * ('b', 4, 'o', true) or ('b', 0b00000100, 'o', true) will set pin 2 of port B as output high.
|
124
125
|
def set_port_configuration(port, selection_mask, direction, value)
|
125
126
|
send_request(FUNCTION_SET_PORT_CONFIGURATION, [port, selection_mask, direction, value], 'k C k ?', 0, '')
|
126
127
|
end
|
127
128
|
|
128
129
|
# Returns a direction bitmask and a value bitmask for the specified port.
|
129
130
|
#
|
130
|
-
# For example: A return value of 0b00001111
|
131
|
+
# For example: A return value of (15, 51) or (0b00001111, 0b00110011) for
|
131
132
|
# direction and value means that:
|
132
133
|
#
|
133
134
|
# * pins 0 and 1 are configured as input pull-up,
|
@@ -158,8 +159,8 @@ module Tinkerforge
|
|
158
159
|
# Interrupts are triggered on changes of the voltage level of the pin,
|
159
160
|
# i.e. changes from high to low and low to high.
|
160
161
|
#
|
161
|
-
# For example: ('a', 129) will enable the interrupt for
|
162
|
-
# port a.
|
162
|
+
# For example: ('a', 129) or (a, 0b10000001) will enable the interrupt for
|
163
|
+
# pins 0 and 7 of port a.
|
163
164
|
#
|
164
165
|
# The interrupt is delivered with the callback CALLBACK_INTERRUPT.
|
165
166
|
def set_port_interrupt(port, interrupt_mask)
|
@@ -182,9 +183,9 @@ module Tinkerforge
|
|
182
183
|
# The forth parameter indicates the time (in ms) that the pins should hold
|
183
184
|
# the value.
|
184
185
|
#
|
185
|
-
# If this function is called with the parameters ('a',
|
186
|
-
# Pin 0 will get high and pin 3 will get
|
187
|
-
# low and pin 3 will get high again.
|
186
|
+
# If this function is called with the parameters ('a', 9, 1, 1500) or
|
187
|
+
# ('a', 0b00001001, 0b00000001, 1500): Pin 0 will get high and pin 3 will get
|
188
|
+
# low on port 'a'. In 1.5s pin 0 will get low and pin 3 will get high again.
|
188
189
|
#
|
189
190
|
# A monoflop can be used as a fail-safe mechanism. For example: Lets assume you
|
190
191
|
# have a RS485 bus and an IO-16 Bricklet connected to one of the slave
|
@@ -212,8 +213,8 @@ module Tinkerforge
|
|
212
213
|
# according to the selection mask. The bitmask is 8 bit long, *true* refers
|
213
214
|
# to high and *false* refers to low.
|
214
215
|
#
|
215
|
-
# For example: The
|
216
|
-
# pin 6 low, pins 0-6 will remain untouched.
|
216
|
+
# For example: The parameters ('a', 192, 128) or ('a', 0b11000000, 0b10000000)
|
217
|
+
# will turn pin 7 high and pin 6 low on port A, pins 0-6 will remain untouched.
|
217
218
|
#
|
218
219
|
# .. note::
|
219
220
|
# This function does nothing for pins that are configured as input.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 #
|
@@ -22,9 +22,9 @@ module Tinkerforge
|
|
22
22
|
#
|
23
23
|
# For example:
|
24
24
|
#
|
25
|
-
# * (1, 1) means that an interrupt on pin 0 occurred and
|
25
|
+
# * (1, 1) or (0b0001, 0b0001) means that an interrupt on pin 0 occurred and
|
26
26
|
# currently pin 0 is high and pins 1-3 are low.
|
27
|
-
# * (9, 14) means that interrupts on pins 0 and 3
|
27
|
+
# * (9, 14) or (0b1001, 0b1110) means that interrupts on pins 0 and 3
|
28
28
|
# occurred and currently pin 0 is low and pins 1-3 are high.
|
29
29
|
CALLBACK_INTERRUPT = 9
|
30
30
|
|
@@ -87,9 +87,9 @@ module Tinkerforge
|
|
87
87
|
end
|
88
88
|
|
89
89
|
# Sets the output value (high or low) with a bitmask. The bitmask
|
90
|
-
# is
|
90
|
+
# is 4bit long, *true* refers to high and *false* refers to low.
|
91
91
|
#
|
92
|
-
# For example: The value 0b0011 will turn the pins 0-1 high and the
|
92
|
+
# For example: The value 3 or 0b0011 will turn the pins 0-1 high and the
|
93
93
|
# pins 2-3 low.
|
94
94
|
#
|
95
95
|
# .. note::
|
@@ -107,7 +107,7 @@ module Tinkerforge
|
|
107
107
|
end
|
108
108
|
|
109
109
|
# Configures the value and direction of the specified pins. Possible directions
|
110
|
-
# are
|
110
|
+
# are 'i' and 'o' for input and output.
|
111
111
|
#
|
112
112
|
# If the direction is configured as output, the value is either high or low
|
113
113
|
# (set as *true* or *false*).
|
@@ -117,23 +117,23 @@ module Tinkerforge
|
|
117
117
|
#
|
118
118
|
# For example:
|
119
119
|
#
|
120
|
-
# * (15, 'i', true) will set all pins of as input pull-up.
|
121
|
-
# * (8, 'i', false) will set pin 3 of as input default (floating if nothing is connected).
|
122
|
-
# * (3, 'o', false) will set pins 0 and 1 as output low.
|
123
|
-
# * (4, 'o', true) will set pin 2 of as output high.
|
120
|
+
# * (15, 'i', true) or (0b1111, 'i', true) will set all pins of as input pull-up.
|
121
|
+
# * (8, 'i', false) or (0b1000, 'i', false) will set pin 3 of as input default (floating if nothing is connected).
|
122
|
+
# * (3, 'o', false) or (0b0011, 'o', false) will set pins 0 and 1 as output low.
|
123
|
+
# * (4, 'o', true) or (0b0100, 'o', true) will set pin 2 of as output high.
|
124
124
|
def set_configuration(selection_mask, direction, value)
|
125
125
|
send_request(FUNCTION_SET_CONFIGURATION, [selection_mask, direction, value], 'C k ?', 0, '')
|
126
126
|
end
|
127
127
|
|
128
128
|
# Returns a value bitmask and a direction bitmask.
|
129
129
|
#
|
130
|
-
# For example: A return value of 0b0011
|
131
|
-
#
|
130
|
+
# For example: A return value of (3, 5) or (0b0011, 0b0101) for direction and
|
131
|
+
# value means that:
|
132
132
|
#
|
133
133
|
# * pin 0 is configured as input pull-up,
|
134
134
|
# * pin 1 is configured as input default,
|
135
|
-
# * pin 2 is configured as output high
|
136
|
-
# *
|
135
|
+
# * pin 2 is configured as output high and
|
136
|
+
# * pin 3 is are configured as output low.
|
137
137
|
def get_configuration
|
138
138
|
send_request(FUNCTION_GET_CONFIGURATION, [], '', 2, 'C C')
|
139
139
|
end
|
@@ -158,8 +158,8 @@ module Tinkerforge
|
|
158
158
|
# Interrupts are triggered on changes of the voltage level of the pin,
|
159
159
|
# i.e. changes from high to low and low to high.
|
160
160
|
#
|
161
|
-
# For example: An interrupt bitmask of
|
162
|
-
# pins
|
161
|
+
# For example: An interrupt bitmask of 10 or 0b1010 will enable the interrupt for
|
162
|
+
# pins 1 and 3.
|
163
163
|
#
|
164
164
|
# The interrupt is delivered with the callback CALLBACK_INTERRUPT.
|
165
165
|
def set_interrupt(interrupt_mask)
|
@@ -181,9 +181,9 @@ module Tinkerforge
|
|
181
181
|
# The third parameter indicates the time (in ms) that the pins should hold
|
182
182
|
# the value.
|
183
183
|
#
|
184
|
-
# If this function is called with the parameters (
|
185
|
-
# Pin 0 will get high and pin 3 will get low. In 1.5s pin
|
186
|
-
# 3 will get high again.
|
184
|
+
# If this function is called with the parameters (9, 1, 1500) or
|
185
|
+
# (0b1001, 0b0001, 1500): Pin 0 will get high and pin 3 will get low. In 1.5s pin
|
186
|
+
# 0 will get low and pin 3 will get high again.
|
187
187
|
#
|
188
188
|
# A monoflop can be used as a fail-safe mechanism. For example: Lets assume you
|
189
189
|
# have a RS485 bus and an IO-4 Bricklet connected to one of the slave
|
@@ -211,8 +211,8 @@ module Tinkerforge
|
|
211
211
|
# the selection mask. The bitmask is 4 bit long, *true* refers to high
|
212
212
|
# and *false* refers to low.
|
213
213
|
#
|
214
|
-
# For example: The
|
215
|
-
# pin 1 low, pin 0 and 3 will remain untouched.
|
214
|
+
# For example: The parameters (9, 4) or (0b0110, 0b0100) will turn
|
215
|
+
# pin 1 low and pin 2 high, pin 0 and 3 will remain untouched.
|
216
216
|
#
|
217
217
|
# .. note::
|
218
218
|
# This function does nothing for pins that are configured as input.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 #
|
@@ -27,6 +27,8 @@ module Tinkerforge
|
|
27
27
|
FUNCTION_SET_FRAME_DURATION = 3 # :nodoc:
|
28
28
|
FUNCTION_GET_FRAME_DURATION = 4 # :nodoc:
|
29
29
|
FUNCTION_GET_SUPPLY_VOLTAGE = 5 # :nodoc:
|
30
|
+
FUNCTION_SET_CLOCK_FREQUENCY = 7 # :nodoc:
|
31
|
+
FUNCTION_GET_CLOCK_FREQUENCY = 8 # :nodoc:
|
30
32
|
FUNCTION_GET_IDENTITY = 255 # :nodoc:
|
31
33
|
|
32
34
|
|
@@ -35,7 +37,7 @@ module Tinkerforge
|
|
35
37
|
def initialize(uid, ipcon)
|
36
38
|
super uid, ipcon
|
37
39
|
|
38
|
-
@api_version = [2, 0,
|
40
|
+
@api_version = [2, 0, 1]
|
39
41
|
|
40
42
|
@response_expected[FUNCTION_SET_RGB_VALUES] = RESPONSE_EXPECTED_FALSE
|
41
43
|
@response_expected[FUNCTION_GET_RGB_VALUES] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
@@ -43,6 +45,8 @@ module Tinkerforge
|
|
43
45
|
@response_expected[FUNCTION_GET_FRAME_DURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
44
46
|
@response_expected[FUNCTION_GET_SUPPLY_VOLTAGE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
45
47
|
@response_expected[CALLBACK_FRAME_RENDERED] = RESPONSE_EXPECTED_ALWAYS_FALSE
|
48
|
+
@response_expected[FUNCTION_SET_CLOCK_FREQUENCY] = RESPONSE_EXPECTED_FALSE
|
49
|
+
@response_expected[FUNCTION_GET_CLOCK_FREQUENCY] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
46
50
|
@response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
47
51
|
|
48
52
|
@callback_formats[CALLBACK_FRAME_RENDERED] = 'S'
|
@@ -54,9 +58,15 @@ module Tinkerforge
|
|
54
58
|
# The maximum length is 16, the index goes from 0 to 319 and the rgb values
|
55
59
|
# have 8 bits each.
|
56
60
|
#
|
57
|
-
# Example: If you set
|
58
|
-
#
|
59
|
-
#
|
61
|
+
# Example: If you set
|
62
|
+
#
|
63
|
+
# * index to 5,
|
64
|
+
# * length to 3,
|
65
|
+
# * r to [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
66
|
+
# * g to [0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] and
|
67
|
+
# * b to [0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
68
|
+
#
|
69
|
+
# the LED with index 5 will be red, 6 will be green and 7 will be blue.
|
60
70
|
#
|
61
71
|
# The colors will be transfered to actual LEDs when the next
|
62
72
|
# frame duration ends, see BrickletLEDStrip#set_frame_duration.
|
@@ -112,6 +122,37 @@ module Tinkerforge
|
|
112
122
|
send_request(FUNCTION_GET_SUPPLY_VOLTAGE, [], '', 2, 'S')
|
113
123
|
end
|
114
124
|
|
125
|
+
# Sets the frequency of the clock in Hz. The range is 10000Hz (10kHz) up to
|
126
|
+
# 2000000Hz (2MHz).
|
127
|
+
#
|
128
|
+
# The Bricklet will choose the nearest achievable frequency, which may
|
129
|
+
# be off by a few Hz. You can get the exact frequency that is used by
|
130
|
+
# calling BrickletLEDStrip#get_clock_frequency.
|
131
|
+
#
|
132
|
+
# If you have problems with flickering LEDs, they may be bits flipping. You
|
133
|
+
# can fix this by either making the connection between the LEDs and the
|
134
|
+
# Bricklet shorter or by reducing the frequency.
|
135
|
+
#
|
136
|
+
# With a decreasing frequency your maximum frames per second will decrease
|
137
|
+
# too.
|
138
|
+
#
|
139
|
+
# The default value is 1.66MHz.
|
140
|
+
#
|
141
|
+
# .. note::
|
142
|
+
# The frequency in firmware version 2.0.0 is fixed at 2MHz.
|
143
|
+
#
|
144
|
+
# .. versionadded:: 2.0.1~(Plugin)
|
145
|
+
def set_clock_frequency(frequency)
|
146
|
+
send_request(FUNCTION_SET_CLOCK_FREQUENCY, [frequency], 'L', 0, '')
|
147
|
+
end
|
148
|
+
|
149
|
+
# Returns the currently used clock frequency.
|
150
|
+
#
|
151
|
+
# .. versionadded:: 2.0.1~(Plugin)
|
152
|
+
def get_clock_frequency
|
153
|
+
send_request(FUNCTION_GET_CLOCK_FREQUENCY, [], '', 4, 'L')
|
154
|
+
end
|
155
|
+
|
115
156
|
# Returns the UID, the UID where the Bricklet is connected to,
|
116
157
|
# the position, the hardware and firmware version as well as the
|
117
158
|
# device identifier.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
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 #
|
@@ -46,7 +46,11 @@ module Tinkerforge
|
|
46
46
|
|
47
47
|
# Returns 1 if a motion was detected. How long this returns 1 after a motion
|
48
48
|
# was detected can be adjusted with one of the small potentiometers on the
|
49
|
-
# Motion Detector Bricklet, see :ref:`here
|
49
|
+
# Motion Detector Bricklet, see :ref:`here
|
50
|
+
# <motion_detector_bricklet_sensitivity_delay_block_time>`.
|
51
|
+
#
|
52
|
+
# There is also a blue LED on the Bricklet that is on as long as the Bricklet is
|
53
|
+
# in the "motion detected" state.
|
50
54
|
def get_motion_detected
|
51
55
|
send_request(FUNCTION_GET_MOTION_DETECTED, [], '', 1, 'C')
|
52
56
|
end
|