apa102_rbpi 0.1.0.beta → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apa102_rbpi/apa102.rb +5 -5
- data/lib/apa102_rbpi/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebaede96b65b0998eb0b0240b877099d3fd52acf
|
4
|
+
data.tar.gz: 475dc85eb79b055ba395ad17984c8ce03841df8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aa988f8accd6911fc6a3a1b32655f7c44616a94a670ac39fde9e1e0ef56f0774b085b2b3cfd27e73926d513d29f5d889d95417003ef9ed0862dec8079dd33b3
|
7
|
+
data.tar.gz: 161f714ff6c8b79cdce2aaeb18c81f83b626de651a4f01b980e3219274ebf85a63782240e5a94f62d5cb00a2d7ce40ac33171b15fee7ce89654566568b4fc327
|
data/lib/apa102_rbpi/apa102.rb
CHANGED
@@ -8,18 +8,18 @@ module Apa102Rbpi
|
|
8
8
|
|
9
9
|
attr_accessor :brightness
|
10
10
|
|
11
|
-
def initialize(opts)
|
12
|
-
@num_leds
|
11
|
+
def initialize(opts = {})
|
12
|
+
@num_leds = opts[:num_leds] || 1
|
13
13
|
@brightness = opts[:brightness] || 31
|
14
|
-
@spi_hz
|
14
|
+
@spi_hz = opts[:spi_hz] || 8000000
|
15
15
|
|
16
16
|
# some strips may have different led frame specs
|
17
17
|
# set offsets if using a non-default strip
|
18
18
|
# offset: 0 1 2 3
|
19
19
|
# frame = [header|blue|green|red],
|
20
|
-
@led_frame_blue_offset
|
20
|
+
@led_frame_blue_offset = opts[:led_frame_blue_offset] || 1
|
21
21
|
@led_frame_green_offset = opts[:led_frame_green_offset] || 2
|
22
|
-
@led_frame_red_offset
|
22
|
+
@led_frame_red_offset = opts[:led_frame_red_offset] || 3
|
23
23
|
|
24
24
|
@led_frames = []
|
25
25
|
@end_frame = [0x00] * (@num_leds / 2.0).ceil
|
data/lib/apa102_rbpi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apa102_rbpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- matl33t
|
@@ -87,9 +87,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- - "
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
92
|
+
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
95
|
rubygems_version: 2.2.3
|