dream-cheeky-led 0.0.1.pre → 0.0.1.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -6
- data/lib/dream-cheeky/led/ascii_drawing.rb +4 -0
- data/lib/dream-cheeky/led/device.rb +6 -2
- data/lib/dream-cheeky/led/version.rb +1 -1
- 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: 9609126edfbb40acf9c817b6bb9087e89b598c9f
|
4
|
+
data.tar.gz: 7be096190ab4d7a82153bf1dcdf06c68071f54c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe624bf7be96fa106ebba55429648080f1cf4d8f8de4b182d9b7bfb1caf57cb6834f4f610dfdce00d0f2b8bc22f5387bd06d1d6573f98aecd32a1db9b03fb2ed
|
7
|
+
data.tar.gz: c5c2d54ae01153e33d908beeab6cf2c24c0d4cd36c01a06494390e2c3fadf061fae203b825b374bde237d24f4217a8b7147a0b2ca89c503940b59ac55666ee13
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ For scrolling text, see also:
|
|
17
17
|
|
18
18
|
Add this line to your application's Gemfile:
|
19
19
|
|
20
|
-
gem 'dream-cheeky-led', '0.0.1.
|
20
|
+
gem 'dream-cheeky-led', '0.0.1.pre2'
|
21
21
|
|
22
22
|
And then execute:
|
23
23
|
|
@@ -39,11 +39,13 @@ require 'dream-cheeky/led'
|
|
39
39
|
message_board = DreamCheeky::LEDMessageBoard.first
|
40
40
|
|
41
41
|
art = <<-ART
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
*
|
42
|
+
***** *** ***
|
43
|
+
* **** * * * *
|
44
|
+
* ***** * * * *
|
45
|
+
* **** * * ***
|
46
|
+
* *** *** * *
|
47
|
+
*** * * * *
|
48
|
+
* * * * ***
|
47
49
|
ART
|
48
50
|
|
49
51
|
message_board.draw(art)
|
@@ -60,6 +62,20 @@ loop do
|
|
60
62
|
end
|
61
63
|
```
|
62
64
|
|
65
|
+
### Drawing from pixel data
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
pixel_data = [
|
69
|
+
[1, 0, 0, 0, 1],
|
70
|
+
[0, 1, 0, 1, 0],
|
71
|
+
[0, 0, 1, 0, 0],
|
72
|
+
[0, 1, 0, 1, 0],
|
73
|
+
[1, 0, 0, 0, 1]
|
74
|
+
]
|
75
|
+
|
76
|
+
message_board.draw_pixels(pixel_data)
|
77
|
+
```
|
78
|
+
|
63
79
|
## Contributing
|
64
80
|
|
65
81
|
1. Fork it ( http://github.com/aupajo/dream-cheeky-led/fork )
|
@@ -25,8 +25,12 @@ module DreamCheeky
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def draw(ascii)
|
28
|
-
|
29
|
-
|
28
|
+
pixel_data = ASCIIDrawing.new(ascii).pixel_data
|
29
|
+
draw_pixels(pixel_data)
|
30
|
+
end
|
31
|
+
|
32
|
+
def draw_pixels(pixel_data)
|
33
|
+
screen_state = ScreenState.new(pixel_data)
|
30
34
|
send_packets(screen_state.packets)
|
31
35
|
end
|
32
36
|
|