Class: Tinkerforge::BrickletLEDStripV2
- Inherits:
-
Object
- Object
- Tinkerforge::BrickletLEDStripV2
- Defined in:
- lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.rb
Instance Method Summary collapse
-
#blackout ⇒ Object
Switches off all connected LEDs.
-
#channels ⇒ Object
Returns the channels as defined by the channel mapping.
-
#state ⇒ Object
Returns the device’s state.
Instance Method Details
#blackout ⇒ Object
Switches off all connected LEDs. Use in case of misconfiguration or other trouble.
Sends the connected LEDs 6144 zeros (2048 RGB values or 1536 RGBW values).
8 9 10 11 12 |
# File 'lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.rb', line 8 def blackout a = Array.new(1024,0) 6.times { |n| set_led_values( n*1024, a ) } true end |
#channels ⇒ Object
Returns the channels as defined by the channel mapping.
15 16 17 18 19 20 21 |
# File 'lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.rb', line 15 def channels if ch = lookup_channel_mapping(get_channel_mapping) ch[1].chars else ch end end |
#state ⇒ Object
Returns the device’s state.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.rb', line 24 def state super.merge( 'chip_type' => get_chip_type, 'channel_mapping' => get_channel_mapping, 'channels' => channels, 'frame_duration' => get_frame_duration, 'clock_frequency' => get_clock_frequency, 'supply_voltage' => get_supply_voltage, ) end |