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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95e5a7d14600aa08f271d1d80a0b4974fcbf0663
4
- data.tar.gz: a7982c55c9e88eed97afb6693004c7bb8721d2d6
3
+ metadata.gz: 9609126edfbb40acf9c817b6bb9087e89b598c9f
4
+ data.tar.gz: 7be096190ab4d7a82153bf1dcdf06c68071f54c8
5
5
  SHA512:
6
- metadata.gz: ee8d873c3507793b4ba7de6042f9deafd19983dd7ba112cf7f0db0763cc3f2002a70937a9e8cdeda8028179454ec0a14965102f587b06197e5ba565310ec2d9b
7
- data.tar.gz: 974be5400e861ceb1bae36f524ec9eca88607cdb6c2fc075c27f3e587fc1246366c9cc913f7017cf745ccf01328fc210282ad127a827e8c6d6489034a8297ce5
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.pre'
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 )
@@ -14,6 +14,10 @@ module DreamCheeky
14
14
  Pattern.new(rows)
15
15
  end
16
16
 
17
+ def pixel_data
18
+ rows
19
+ end
20
+
17
21
  def self.to_pattern(string)
18
22
  self.new(string).to_pattern
19
23
  end
@@ -25,8 +25,12 @@ module DreamCheeky
25
25
  end
26
26
 
27
27
  def draw(ascii)
28
- pattern = Pattern.from_ascii(ascii)
29
- screen_state = ScreenState.new(pattern.to_a)
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
 
@@ -1,5 +1,5 @@
1
1
  module DreamCheeky
2
2
  module LEDMessageBoard
3
- VERSION = "0.0.1.pre"
3
+ VERSION = "0.0.1.pre2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dream-cheeky-led
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre
4
+ version: 0.0.1.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Nicholls