arduino-lights 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arduino-lights.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 633801e321c836b66a0770951b1bf12fa012ba01
|
4
|
+
data.tar.gz: a29073c6c45d0e03061c7cb364ad4725b2848131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df7cb35ad00468e8dba1e7cf1966359567942091421986592f131e02cdf001a35b959afc9b1a4cdba966be9ad4c990589788677f2d5dac640b08ef4c7ed2498f
|
7
|
+
data.tar.gz: 51b557c14abf057409d624f61f4351a851aba10ba672c49e10b8da4b8c1688878882d7eea3ccfe3b51cbe3e43738f4c60cb2bc9fd29e607b9f93c7a02f5eff9b
|
data/lib/arduino-lights.rb
CHANGED
@@ -7,7 +7,7 @@ module ArduinoLights
|
|
7
7
|
|
8
8
|
def self.serial_port
|
9
9
|
@port ||= begin
|
10
|
-
res = SerialPort.new(SERIAL_PORT,
|
10
|
+
res = SerialPort.new(SERIAL_PORT, SERIAL_RATE, 8, 1, SerialPort::NONE)
|
11
11
|
sleep(2)
|
12
12
|
res
|
13
13
|
end
|
@@ -50,9 +50,9 @@ end
|
|
50
50
|
if __FILE__ == $0
|
51
51
|
pixel = 0
|
52
52
|
while (true)
|
53
|
-
pixels = (0..(
|
53
|
+
pixels = (0..(ArduinoLights::PIXELS-1)).map { [0,0,0] }
|
54
54
|
pixels[pixel] = [100,50,50]
|
55
|
-
|
56
|
-
pixel = (pixel + 1) %
|
55
|
+
ArduinoLights::draw_pixel_map(pixels)
|
56
|
+
pixel = (pixel + 1) % ArduinoLights::PIXELS
|
57
57
|
end
|
58
58
|
end
|