tinderfridge 0.4.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinderfridge/device.rb +67 -3
  3. data/lib/tinderfridge/device_collection.rb +52 -0
  4. data/lib/tinderfridge/device_info.txt +3 -0
  5. data/lib/tinderfridge/devices/brick_hat/brick_hat.json +11 -0
  6. data/lib/tinderfridge/devices/{brick_hat.rb → brick_hat/brick_hat.rb} +0 -0
  7. data/lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.json +11 -0
  8. data/lib/tinderfridge/devices/{brick_hat_zero.rb → brick_hat_zero/brick_hat_zero.rb} +0 -0
  9. data/lib/tinderfridge/devices/bricklet_accelerometer_v2/bricklet_accelerometer_v2.json +11 -0
  10. data/lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.json +11 -0
  11. data/lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.rb +20 -0
  12. data/lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.json +10 -0
  13. data/lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.rb +19 -0
  14. data/lib/tinderfridge/devices/bricklet_analog_in_v3/bricklet_analog_in_v3.json +10 -0
  15. data/lib/tinderfridge/devices/bricklet_analog_out_v3/bricklet_analog_out_v3.json +11 -0
  16. data/lib/tinderfridge/devices/bricklet_barometer_v2/bricklet_barometer_v2.json +11 -0
  17. data/lib/tinderfridge/devices/bricklet_can_v2/bricklet_can_v2.json +11 -0
  18. data/lib/tinderfridge/devices/bricklet_co2_v2/bricklet_co2_v2.json +10 -0
  19. data/lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.json +10 -0
  20. data/lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.rb +31 -0
  21. data/lib/tinderfridge/devices/bricklet_compass/bricklet_compass.json +10 -0
  22. data/lib/tinderfridge/devices/bricklet_dc_v2/bricklet_dc_v2.json +11 -0
  23. data/lib/tinderfridge/devices/bricklet_distance_ir_v2/bricklet_distance_ir_v2.json +11 -0
  24. data/lib/tinderfridge/devices/bricklet_distance_us_v2/bricklet_distance_us_v2.json +10 -0
  25. data/lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.json +10 -0
  26. data/lib/tinderfridge/devices/{bricklet_dmx.rb → bricklet_dmx/bricklet_dmx.rb} +0 -0
  27. data/lib/tinderfridge/devices/bricklet_dual_button_v2/bricklet_dual_button_v2.json +11 -0
  28. data/lib/tinderfridge/devices/bricklet_e_paper_296x128/bricklet_e_paper_296x128.json +10 -0
  29. data/lib/tinderfridge/devices/bricklet_energy_monitor/bricklet_energy_monitor.json +10 -0
  30. data/lib/tinderfridge/devices/bricklet_gps_v2/bricklet_gps_v2.json +10 -0
  31. data/lib/tinderfridge/devices/{bricklet_gps_v2.rb → bricklet_gps_v2/bricklet_gps_v2.rb} +0 -0
  32. data/lib/tinderfridge/devices/bricklet_hall_effect_v2/bricklet_hall_effect_v2.json +10 -0
  33. data/lib/tinderfridge/devices/bricklet_humidity_v2/bricklet_humidity_v2.json +10 -0
  34. data/lib/tinderfridge/devices/bricklet_imu_v3/bricklet_imu_v3.json +10 -0
  35. data/lib/tinderfridge/devices/bricklet_industrial_analog_out_v2/bricklet_industrial_analog_out_v2.json +11 -0
  36. data/lib/tinderfridge/devices/bricklet_industrial_counter/bricklet_industrial_counter.json +11 -0
  37. data/lib/tinderfridge/devices/bricklet_industrial_digital_in_4_v2/bricklet_industrial_digital_in_4_v2.json +11 -0
  38. data/lib/tinderfridge/devices/bricklet_industrial_digital_out_4_v2/bricklet_industrial_digital_out_4_v2.json +11 -0
  39. data/lib/tinderfridge/devices/bricklet_industrial_dual_0_20ma_v2/bricklet_industrial_dual_0_20ma_v2.json +11 -0
  40. data/lib/tinderfridge/devices/bricklet_industrial_dual_ac_relay/bricklet_industrial_dual_ac_relay.json +11 -0
  41. data/lib/tinderfridge/devices/bricklet_industrial_dual_analog_in_v2/bricklet_industrial_dual_analog_in_v2.json +11 -0
  42. data/lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.json +10 -0
  43. data/lib/tinderfridge/devices/{bricklet_industrial_dual_relay.rb → bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.rb} +0 -0
  44. data/lib/tinderfridge/devices/bricklet_industrial_ptc/bricklet_industrial_ptc.json +11 -0
  45. data/lib/tinderfridge/devices/bricklet_industrial_quad_relay_v2/bricklet_industrial_quad_relay_v2.json +11 -0
  46. data/lib/tinderfridge/devices/bricklet_io16_v2/bricklet_io16_v2.json +11 -0
  47. data/lib/tinderfridge/devices/bricklet_io4_v2/bricklet_io4_v2.json +11 -0
  48. data/lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.json +10 -0
  49. data/lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.rb +17 -0
  50. data/lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.json +10 -0
  51. data/lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.rb +15 -0
  52. data/lib/tinderfridge/devices/bricklet_laser_range_finder_v2/bricklet_laser_range_finder_v2.json +10 -0
  53. data/lib/tinderfridge/devices/bricklet_lcd_128x64/bricklet_lcd_128x64.json +10 -0
  54. data/lib/tinderfridge/devices/{bricklet_lcd_128x64.rb → bricklet_lcd_128x64/bricklet_lcd_128x64.rb} +0 -0
  55. data/lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.json +11 -0
  56. data/lib/tinderfridge/devices/{bricklet_led_strip_v2.rb → bricklet_led_strip_v2/bricklet_led_strip_v2.rb} +0 -0
  57. data/lib/tinderfridge/devices/bricklet_linear_poti_v2/bricklet_linear_poti_v2.json +10 -0
  58. data/lib/tinderfridge/devices/bricklet_load_cell_v2/bricklet_load_cell_v2.json +11 -0
  59. data/lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.json +10 -0
  60. data/lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.rb +22 -0
  61. data/lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.json +10 -0
  62. data/lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.rb +42 -0
  63. data/lib/tinderfridge/devices/bricklet_multi_touch_v2/bricklet_multi_touch_v2.json +10 -0
  64. data/lib/tinderfridge/devices/{bricklet_multi_touch_v2.rb → bricklet_multi_touch_v2/bricklet_multi_touch_v2.rb} +0 -0
  65. data/lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.json +10 -0
  66. data/lib/tinderfridge/devices/{bricklet_nfc.rb → bricklet_nfc/bricklet_nfc.rb} +0 -0
  67. data/lib/tinderfridge/devices/bricklet_oled_128x64_v2/bricklet_oled_128x64_v2.json +11 -0
  68. data/lib/tinderfridge/devices/bricklet_one_wire/bricklet_one_wire.json +11 -0
  69. data/lib/tinderfridge/devices/bricklet_outdoor_weather/bricklet_outdoor_weather.json +10 -0
  70. data/lib/tinderfridge/devices/{bricklet_outdoor_weather.rb → bricklet_outdoor_weather/bricklet_outdoor_weather.rb} +0 -0
  71. data/lib/tinderfridge/devices/bricklet_particulate_matter/bricklet_particulate_matter.json +11 -0
  72. data/lib/tinderfridge/devices/bricklet_performance_dc/bricklet_performance_dc.json +11 -0
  73. data/lib/tinderfridge/devices/bricklet_piezo_speaker_v2/bricklet_piezo_speaker_v2.json +10 -0
  74. data/lib/tinderfridge/devices/bricklet_ptc_v2/bricklet_ptc_v2.json +11 -0
  75. data/lib/tinderfridge/devices/bricklet_real_time_clock_v2/bricklet_real_time_clock_v2.json +10 -0
  76. data/lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.json +10 -0
  77. data/lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.rb +15 -0
  78. data/lib/tinderfridge/devices/bricklet_rgb_led_button/bricklet_rgb_led_button.json +10 -0
  79. data/lib/tinderfridge/devices/{bricklet_rgb_led_button.rb → bricklet_rgb_led_button/bricklet_rgb_led_button.rb} +9 -0
  80. data/lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.json +10 -0
  81. data/lib/tinderfridge/devices/{bricklet_rgb_led_v2.rb → bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb} +7 -0
  82. data/lib/tinderfridge/devices/bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.json +10 -0
  83. data/lib/tinderfridge/devices/bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.rb +20 -0
  84. data/lib/tinderfridge/devices/bricklet_rotary_poti_v2/bricklet_rotary_poti_v2.json +10 -0
  85. data/lib/tinderfridge/devices/bricklet_rs232_v2/bricklet_rs232_v2.json +11 -0
  86. data/lib/tinderfridge/devices/bricklet_rs485/bricklet_rs485.json +11 -0
  87. data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.json +11 -0
  88. data/lib/tinderfridge/devices/{bricklet_segment_display_4x7_v2.rb → bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb} +23 -1
  89. data/lib/tinderfridge/devices/bricklet_servo_v2/bricklet_servo_v2.json +11 -0
  90. data/lib/tinderfridge/devices/bricklet_silent_stepper_v2/bricklet_silent_stepper_v2.json +11 -0
  91. data/lib/tinderfridge/devices/bricklet_solid_state_relay_v2/bricklet_solid_state_relay_v2.json +11 -0
  92. data/lib/tinderfridge/devices/bricklet_sound_pressure_level/bricklet_sound_pressure_level.json +10 -0
  93. data/lib/tinderfridge/devices/bricklet_temperature_ir_v2/bricklet_temperature_ir_v2.json +10 -0
  94. data/lib/tinderfridge/devices/bricklet_temperature_v2/bricklet_temperature_v2.json +10 -0
  95. data/lib/tinderfridge/devices/bricklet_thermal_imaging/bricklet_thermal_imaging.json +10 -0
  96. data/lib/tinderfridge/devices/bricklet_thermocouple_v2/bricklet_thermocouple_v2.json +10 -0
  97. data/lib/tinderfridge/devices/bricklet_uv_light_v2/bricklet_uv_light_v2.json +10 -0
  98. data/lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.json +10 -0
  99. data/lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.rb +18 -0
  100. data/lib/tinderfridge/devices/bricklet_xmc1400_breakout/bricklet_xmc1400_breakout.json +10 -0
  101. data/lib/tinderfridge/ip_connection.rb +56 -4
  102. data/lib/tinderfridge/tinkerforge.rb +3 -0
  103. data/lib/tinderfridge/version.rb +1 -1
  104. metadata +106 -23
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 145,
4
+ 20,
5
+ 28
6
+ ],
7
+ "weight": 67,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Motorized_Linear_Poti.html",
9
+ "versions_identifier": "bricklets:motorized_linear_poti"
10
+ }
@@ -0,0 +1,42 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletMotorizedLinearPoti
4
+
5
+ # Returns the position of the potentiometer (an integer in the range 0..100).
6
+ def position
7
+ get_position
8
+ end
9
+
10
+ # Moves the potentiometer to the given position.
11
+ #
12
+ # If the potentiometer was locked before, it will be locked at the new position.
13
+ # The drive mode (speed) will be the same as the last time the position was set.
14
+ def position=(position)
15
+ set_motor_position( position, *get_motor_position[1,2] )
16
+ end
17
+
18
+ alias move_to position=
19
+
20
+ # Locks the position of the potentiometer. If a position is given, moves to that position first.
21
+ def lock(position=nil)
22
+ set_motor_position( position || get_position, get_motor_position[1], true )
23
+ end
24
+
25
+ alias hold lock
26
+
27
+ # Releases the potentiometer, so its position can be changed by hand. If a position is given, moves to that position first.
28
+ def release(position=nil)
29
+ set_motor_position( position || get_position, get_motor_position[1], false )
30
+ end
31
+
32
+ # Returns the device's state.
33
+ def state
34
+ super.merge(
35
+ 'position' => get_position,
36
+ 'motor_position' => get_motor_position,
37
+ )
38
+ end
39
+
40
+ end
41
+
42
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 25,
5
+ 7
6
+ ],
7
+ "weight": 4,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Multi_Touch_V2.html",
9
+ "versions_identifier": "bricklets:multi_touch_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 85,
4
+ 50,
5
+ 7
6
+ ],
7
+ "weight": 18,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/NFC.html",
9
+ "versions_identifier": "bricklets:nfc"
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 7
6
+ ],
7
+ "weight": 8.2,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/OLED_128x64_V2.html",
9
+ "versions_identifier": "bricklets:oled_128x64_v2",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 30,
5
+ 14
6
+ ],
7
+ "weight": 6.5,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/One_Wire.html",
9
+ "versions_identifier": "bricklets:one_wire",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 35,
5
+ 5
6
+ ],
7
+ "weight": 10,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Outdoor_Weather.html",
9
+ "versions_identifier": "bricklets:outdoor_weather"
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 70,
4
+ 40,
5
+ 15
6
+ ],
7
+ "weight": 36.3,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Particulate_Matter.html",
9
+ "versions_identifier": "bricklets:particulate_matter",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 80,
4
+ 80,
5
+ 22
6
+ ],
7
+ "weight": 50,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Performance_DC.html",
9
+ "versions_identifier": "bricklets:performance_dc",
10
+ "released": "2021-01-14"
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 55,
4
+ 45,
5
+ 20
6
+ ],
7
+ "weight": 20,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Piezo_Speaker_V2.html",
9
+ "versions_identifier": "bricklets:piezo_speaker_v2"
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 35,
4
+ 30,
5
+ 15
6
+ ],
7
+ "weight": 9,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/PTC_V2.html",
9
+ "versions_identifier": "bricklets:ptc_v2",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 25,
5
+ 5
6
+ ],
7
+ "weight": 3,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/RealTime_Clock_V2.html",
9
+ "versions_identifier": "bricklets:real_time_clock_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 40,
5
+ 5
6
+ ],
7
+ "weight": 8,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Remote_Switch_V2.html",
9
+ "versions_identifier": "bricklets:remote_switch_v2"
10
+ }
@@ -0,0 +1,15 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletRemoteSwitchV2
4
+
5
+ # Returns the device's state.
6
+ def state
7
+ super.merge(
8
+ 'remote_configuration' => get_remote_configuration,
9
+ 'repeats' => get_repeats,
10
+ )
11
+ end
12
+
13
+ end
14
+
15
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 25,
5
+ 30
6
+ ],
7
+ "weight": 7,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/RGB_LED_Button.html",
9
+ "versions_identifier": "bricklets:rgb_led_button"
10
+ }
@@ -20,6 +20,15 @@ module Tinkerforge
20
20
  true
21
21
  end
22
22
 
23
+ # Returns the device's state.
24
+ def state
25
+ super.merge(
26
+ 'color_rgb' => get_color,
27
+ 'color_calibration' => get_color_calibration,
28
+ 'pressed' => get_button_state == 0,
29
+ )
30
+ end
31
+
23
32
  end
24
33
 
25
34
  end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 20,
5
+ 5
6
+ ],
7
+ "weight": 3,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/RGB_LED_V2.html",
9
+ "versions_identifier": "bricklets:rgb_led_v2"
10
+ }
@@ -20,6 +20,13 @@ module Tinkerforge
20
20
  true
21
21
  end
22
22
 
23
+ # Returns the device's state.
24
+ def state
25
+ super.merge(
26
+ 'color_rgb' => get_rgb_value,
27
+ )
28
+ end
29
+
23
30
  end
24
31
 
25
32
  end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 25,
5
+ 23
6
+ ],
7
+ "weight": 6,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Rotary_Encoder_V2.html",
9
+ "versions_identifier": "bricklets:rotary_encoder_v2"
10
+ }
@@ -0,0 +1,20 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletRotaryEncoderV2
4
+
5
+ # Returns the current count of the encoder.
6
+ def count
7
+ get_count(false)
8
+ end
9
+
10
+ # Returns the device's state.
11
+ def state
12
+ super.merge(
13
+ 'count' => count,
14
+ 'pressed' => is_pressed,
15
+ )
16
+ end
17
+
18
+ end
19
+
20
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 25,
5
+ 23
6
+ ],
7
+ "weight": 7,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Rotary_Poti_V2.html",
9
+ "versions_identifier": "bricklets:rotary_poti_v2"
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 45,
4
+ 35,
5
+ 17
6
+ ],
7
+ "weight": 20,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/RS232_V2.html",
9
+ "versions_identifier": "bricklets:rs232_v2",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 14
6
+ ],
7
+ "weight": 13,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/RS485.html",
9
+ "versions_identifier": "bricklets:rs485",
10
+ "released": "2017-07-26"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 65,
5
+ 9
6
+ ],
7
+ "weight": 11,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Segment_Display_4x7_V2.html",
9
+ "versions_identifier": "bricklets:segment_display_4x7_v2",
10
+ "released": "2019-05-20"
11
+ }
@@ -12,7 +12,7 @@ module Tinkerforge
12
12
 
13
13
  # Returns the state of all 35 segments.
14
14
  def segments
15
- send_request FUNCTION_GET_SEGMENTS, [], '', 14, '?35'
15
+ get_segments.flatten
16
16
  end
17
17
 
18
18
  # Sets the state of all 35 segments.
@@ -123,6 +123,28 @@ module Tinkerforge
123
123
  }
124
124
  end
125
125
 
126
+ # Displays an 8-segment bar graph for 1 or 2 values in the range 0..1.
127
+ #
128
+ # @example
129
+ # my_bricklet.bar_graph 0.5
130
+ # my_bricklet.bar_graph 0.5, 0.8
131
+ def bar_graph(value1, value2=value1)
132
+ value1, value2 = [value1, value2].map { |v| (v.to_f.clamp(0,1) * 8).round }
133
+
134
+ frame = [false] * 35
135
+
136
+ [ 5, 1, 13, 9, 21, 17, 29, 25 ].first(value1).each do |n|
137
+ frame[n] = true
138
+ end
139
+
140
+ [ 4, 2, 12, 10, 20, 18, 28, 26 ].first(value2).each do |n|
141
+ frame[n] = true
142
+ end
143
+
144
+ self.segments = frame
145
+ [value1, value2]
146
+ end
147
+
126
148
  end
127
149
 
128
150
  end
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 10
6
+ ],
7
+ "weight": 9,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Servo_V2.html",
9
+ "versions_identifier": "bricklets:servo_v2",
10
+ "released": "2021-01-14"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 15
6
+ ],
7
+ "weight": 12,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Silent_Stepper_V2.html",
9
+ "versions_identifier": "bricklets:silent_stepper_v2",
10
+ "released": "2021-05-04"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 19,
4
+ 33.4,
5
+ 5
6
+ ],
7
+ "weight": 2,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Solid_State_Relay_V2.html",
9
+ "versions_identifier": "bricklets:solid_state_relay_v2",
10
+ "released": "2018-02-26"
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 25,
5
+ 6
6
+ ],
7
+ "weight": 2.6,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Sound_Pressure_Level.html",
9
+ "versions_identifier": "bricklets:sound_pressure_level"
10
+ }