rpi_rgb 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rpi_rgb.rb +9 -8
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1848ed1d1f9292e366c714efa43c29634415c467
|
4
|
+
data.tar.gz: dee076a5fae50d6500de3546e1d9cae2f5e406df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1df4ef4cbc8b46ff1b5a63f24997088d965b76cdd057a2598a4ad34857c0d295ff384811693533a530c6a1f982d13e9902cc40c762f51f815e34aab8239327c7
|
7
|
+
data.tar.gz: 1c6fcd6d69c1109e58c08be9f84ebb21c159f6933477baa1f84fc0266fe849f2e5e8688755f339a8e37e17781f5663e5a5affe91286e32ea87e95e7407406c70
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rpi_rgb.rb
CHANGED
@@ -9,7 +9,7 @@ require 'rpi_led'
|
|
9
9
|
|
10
10
|
=begin
|
11
11
|
|
12
|
-
rgb = RPiRGB.new(%w(4 17 27), presets: {purple: [
|
12
|
+
rgb = RPiRGB.new(%w(4 17 27), presets: {purple: [100,100,0]})
|
13
13
|
rgb.color = 'white'
|
14
14
|
sleep 2
|
15
15
|
rgb.color = 'purple'
|
@@ -29,7 +29,7 @@ class RPiRGB
|
|
29
29
|
RPiLed.new(x, brightness: brightness, smooth: smooth)
|
30
30
|
end
|
31
31
|
|
32
|
-
@brightness, @presets = brightness, presets
|
32
|
+
@brightness, @presets = brightness, presets
|
33
33
|
|
34
34
|
end
|
35
35
|
|
@@ -50,16 +50,16 @@ class RPiRGB
|
|
50
50
|
case val
|
51
51
|
|
52
52
|
when 'red'
|
53
|
-
mix
|
53
|
+
mix 100, 0, 0
|
54
54
|
|
55
55
|
when 'green'
|
56
|
-
mix 0,
|
56
|
+
mix 0, 100, 0
|
57
57
|
|
58
58
|
when 'blue'
|
59
|
-
mix 0, 0,
|
59
|
+
mix 0, 0, 100
|
60
60
|
|
61
61
|
when 'white'
|
62
|
-
mix
|
62
|
+
mix 100, 100, 100
|
63
63
|
|
64
64
|
else
|
65
65
|
|
@@ -81,10 +81,11 @@ class RPiRGB
|
|
81
81
|
|
82
82
|
def mix(*values)
|
83
83
|
|
84
|
-
values.flatten
|
84
|
+
r, g, b = values.flatten.map {|v| v / (100 / @brightness ) }
|
85
85
|
|
86
86
|
[@red, @green, @blue].each(&:on)
|
87
|
-
|
87
|
+
|
88
|
+
red.brightness, green.brightness, blue.brightness = r, g, b
|
88
89
|
end
|
89
90
|
|
90
91
|
def off()
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|