SSD1306 0.1.1 → 0.1.2

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: b031d58816b19b11bb94f14762fcc9ab3f01d187
4
- data.tar.gz: 3b4deb86c9018c941db2255405760b2ded612ce8
3
+ metadata.gz: 312a13dc64d461f52cd889de231bef33f4ace668
4
+ data.tar.gz: 1dfd6225f5047ea6c954885b81d4a82aa86d4113
5
5
  SHA512:
6
- metadata.gz: ea3b0571651b1f1608254ebe8fe5f88128881363e2f2719092ec78f8f286af204389e8f2776fba6318b96317f22697a1341cfa7b095374485d97a028847b0b2a
7
- data.tar.gz: b18ad76bf7f16fd14ce822fe1b53c86fbcd1504ed0306f2b2048b986120a7174ce381b6f68964140248ef6a52df2960388a71a8470bb9f246d738448694f74c7
6
+ metadata.gz: 0f85b784d0eb6d0290a3b1e182b360c76dcc7e68beb97cf2a0d9f9d4e3e3f148147901d51c8426d43ff6f1616741cb9419910f7897a9a90b5947d93bb1955c1b
7
+ data.tar.gz: c1a063b908c21fd1e588bb5574bfa2451d46af38770287921418a68fe2aa0840d63befa4a135cc57a9eeb6d889dc271cc8af1ac431c7c5ab9b7e81d4e39fd9ab
@@ -37,7 +37,7 @@ SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL = 0x29
37
37
  SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A
38
38
 
39
39
  class Display
40
- attr_accessor :protocol, :path, :address, :width, :height
40
+ attr_accessor :protocol, :path, :address, :width, :height, :buffer
41
41
 
42
42
  def initialize(opts = {})
43
43
  default_options = {
@@ -49,14 +49,11 @@ SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A
49
49
  }
50
50
  options = default_options.merge(opts)
51
51
 
52
- # Attributes for attr_accessor
53
52
  @protocol = options[:protocol]
54
53
  @path = options[:path]
55
54
  @address = options[:address]
56
55
  @width = options[:width]
57
56
  @height = options[:height]
58
-
59
- # Variables needed internally
60
57
  @pages = @height / 8
61
58
  @buffer = [0]*(@width*@pages)
62
59
  if @protocol == :i2c
@@ -120,7 +117,7 @@ SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A
120
117
  self.command(@pages - 1)
121
118
  # Write buffer data
122
119
  # TODO: This works for I2C only
123
- for i in range(0, @buffer.length, 16)
120
+ for i in (0..@buffer.length).step(16)
124
121
  control = 0x40
125
122
  @interface.write control, @buffer[i:i+16]
126
123
  end
@@ -137,7 +134,7 @@ SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A
137
134
 
138
135
  def clear!
139
136
  self.clear
140
- self.display
137
+ self.display!
141
138
  end
142
139
 
143
140
  #TODO Implement Contrast functionality
@@ -1,3 +1,3 @@
1
1
  module SSD1306
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SSD1306
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xavier Bick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-14 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler