SSD1306 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 583cb9ed975a035e3082a3e202c9d56185a81e17
4
- data.tar.gz: 3fe907a1f54d4efcd0045a0c6ee661b965a3bef1
3
+ metadata.gz: 213295b7f4827ad2d4951591039aeeaa16714f36
4
+ data.tar.gz: cb268e2458e8940cb608f49ab1ccfa16486e4209
5
5
  SHA512:
6
- metadata.gz: 36c323bdd3b0388031b3cf541f6ad14d481c9c8326d765e8728cf0d6ae6cf6e0328d2066859a2fa58c8d1dda1054d4d55a13c8dcf2549094367b8f8f42feb8f6
7
- data.tar.gz: 28b38ecf423ac8c0136c4a85252372f482daf14df3178e7287114c4bd048f1e88cafdd83ac3534c6dd9e69e34852f5fbb61a0ccbf467ce9d6ef46f6a2e60a4f4
6
+ metadata.gz: 8b5983531f3623d01c548fcb6ca42e5e0a954ccffc5ac7d9763920eb43e77ffae696ef2795a5c2eccc8fc2e7691f833994e4ea8509d8ee15d37714f49b92517a
7
+ data.tar.gz: 852e7640d6c49ab3a13224a88a4546eee772992deea4ab264c485333328adbef1643218c06e1e5a3ca73ecbc766424393f43a7d92ea7cd2e8d456a8ca044126d
data/.gitignore CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -38,7 +38,7 @@ Writing text on the display is simple:
38
38
  ```ruby
39
39
  disp.println "This is my IP Address:"
40
40
  disp.println "" # The same as disp.print "\n"
41
- disp.font_size 2
41
+ disp.font_size = 2
42
42
  disp.println ip_address
43
43
  disp.display!
44
44
  ```
@@ -53,7 +53,7 @@ disp.image(image) # Pass in an RMagick image object
53
53
  disp.display!
54
54
  ```
55
55
 
56
- They display can also be easily cleared:
56
+ The display can also be easily cleared:
57
57
 
58
58
  ```ruby
59
59
  disp.clear
@@ -63,7 +63,7 @@ disp.display!
63
63
  disp.clear!
64
64
  ```
65
65
 
66
- Check out the source code for additional information. It's not very hard to read.
66
+ Check out the source code for additional information.
67
67
 
68
68
  ## To-do
69
69
 
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -1,40 +1,40 @@
1
1
  module SSD1306
2
2
  # Constants
3
- SSD1306_I2C_ADDRESS = 0x3C # 011110+SA0+RW - 0x3C or 0x3D
4
- SSD1306_SETCONTRAST = 0x81
3
+ SSD1306_I2C_ADDRESS = 0x3C # 011110+SA0+RW - 0x3C or 0x3D
4
+ SSD1306_SETCONTRAST = 0x81
5
5
  SSD1306_DISPLAYALLON_RESUME = 0xA4
6
- SSD1306_DISPLAYALLON = 0xA5
7
- SSD1306_NORMALDISPLAY = 0xA6
8
- SSD1306_INVERTDISPLAY = 0xA7
9
- SSD1306_DISPLAYOFF = 0xAE
10
- SSD1306_DISPLAYON = 0xAF
11
- SSD1306_SETDISPLAYOFFSET = 0xD3
12
- SSD1306_SETCOMPINS = 0xDA
13
- SSD1306_SETVCOMDETECT = 0xDB
14
- SSD1306_SETDISPLAYCLOCKDIV = 0xD5
15
- SSD1306_SETPRECHARGE = 0xD9
16
- SSD1306_SETMULTIPLEX = 0xA8
17
- SSD1306_SETLOWCOLUMN = 0x00
18
- SSD1306_SETHIGHCOLUMN = 0x10
19
- SSD1306_SETSTARTLINE = 0x40
20
- SSD1306_MEMORYMODE = 0x20
21
- SSD1306_COLUMNADDR = 0x21
22
- SSD1306_PAGEADDR = 0x22
23
- SSD1306_COMSCANINC = 0xC0
24
- SSD1306_COMSCANDEC = 0xC8
25
- SSD1306_SEGREMAP = 0xA0
26
- SSD1306_CHARGEPUMP = 0x8D
27
- SSD1306_EXTERNALVCC = 0x1
28
- SSD1306_SWITCHCAPVCC = 0x2
6
+ SSD1306_DISPLAYALLON = 0xA5
7
+ SSD1306_NORMALDISPLAY = 0xA6
8
+ SSD1306_INVERTDISPLAY = 0xA7
9
+ SSD1306_DISPLAYOFF = 0xAE
10
+ SSD1306_DISPLAYON = 0xAF
11
+ SSD1306_SETDISPLAYOFFSET = 0xD3
12
+ SSD1306_SETCOMPINS = 0xDA
13
+ SSD1306_SETVCOMDETECT = 0xDB
14
+ SSD1306_SETDISPLAYCLOCKDIV = 0xD5
15
+ SSD1306_SETPRECHARGE = 0xD9
16
+ SSD1306_SETMULTIPLEX = 0xA8
17
+ SSD1306_SETLOWCOLUMN = 0x00
18
+ SSD1306_SETHIGHCOLUMN = 0x10
19
+ SSD1306_SETSTARTLINE = 0x40
20
+ SSD1306_MEMORYMODE = 0x20
21
+ SSD1306_COLUMNADDR = 0x21
22
+ SSD1306_PAGEADDR = 0x22
23
+ SSD1306_COMSCANINC = 0xC0
24
+ SSD1306_COMSCANDEC = 0xC8
25
+ SSD1306_SEGREMAP = 0xA0
26
+ SSD1306_CHARGEPUMP = 0x8D
27
+ SSD1306_EXTERNALVCC = 0x1
28
+ SSD1306_SWITCHCAPVCC = 0x2
29
29
 
30
30
  # Scrolling constants
31
- SSD1306_ACTIVATE_SCROLL = 0x2F
31
+ SSD1306_ACTIVATE_SCROLL = 0x2F
32
32
  SSD1306_DEACTIVATE_SCROLL = 0x2E
33
33
  SSD1306_SET_VERTICAL_SCROLL_AREA = 0xA3
34
- SSD1306_RIGHT_HORIZONTAL_SCROLL = 0x26
35
- SSD1306_LEFT_HORIZONTAL_SCROLL = 0x27
34
+ SSD1306_RIGHT_HORIZONTAL_SCROLL = 0x26
35
+ SSD1306_LEFT_HORIZONTAL_SCROLL = 0x27
36
36
  SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL = 0x29
37
- SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A
37
+ SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A
38
38
 
39
39
  class Display
40
40
  attr_accessor :protocol, :path, :address, :width, :height, :buffer, :vccstate, :interface, :cursor
@@ -42,25 +42,25 @@ module SSD1306
42
42
  def initialize(opts = {})
43
43
  default_options = {
44
44
  protocol: :i2c,
45
- path: '/dev/i2c-1',
46
- address: 0x3C,
47
- width: 128,
48
- height: 64,
49
- reset: 24,
45
+ path: '/dev/i2c-1',
46
+ address: 0x3C,
47
+ width: 128,
48
+ height: 64,
49
+ reset: 24,
50
50
  vccstate: SSD1306_SWITCHCAPVCC
51
51
  }
52
52
  options = default_options.merge(opts)
53
53
 
54
54
  @protocol = options[:protocol]
55
- @path = options[:path]
56
- @address = options[:address]
57
- @width = options[:width]
58
- @height = options[:height]
55
+ @path = options[:path]
56
+ @address = options[:address]
57
+ @width = options[:width]
58
+ @height = options[:height]
59
59
  @vccstate = options[:vccstate]
60
- @pages = @height / 8
61
- @buffer = [0]*(@width*@pages)
62
- @cursor = Cursor.new
63
- @reset = options[:reset]
60
+ @pages = @height / 8
61
+ @buffer = [0]*(@width*@pages)
62
+ @cursor = Cursor.new
63
+ @reset = options[:reset]
64
64
  if @protocol == :i2c
65
65
  @interface = I2C.create(@path)
66
66
  elsif @protocol == :spi
@@ -186,16 +186,20 @@ module SSD1306
186
186
  string
187
187
  end
188
188
 
189
- def font_size(new_size)
189
+ def font_size
190
+ return @cursor.size
191
+ end
192
+
193
+ def font_size=(new_size)
190
194
  @cursor.size = new_size
191
195
  end
192
196
 
193
- #TODO Implement Contrast functionality
197
+ # TODO: Implement Contrast functionality
194
198
  def set_contrast(contrast)
195
199
  raise "Contrast not yet implemented"
196
200
  end
197
201
 
198
- #TODO Implement Dimming functionality
202
+ # TODO: Implement Dimming functionality
199
203
  def dim(dim)
200
204
  raise "Dim not implemented yet"
201
205
  end
File without changes
@@ -1,3 +1,3 @@
1
1
  module SSD1306
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xavier Bick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,8 +120,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.6.3
123
+ rubygems_version: 2.6.6
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: A library for the SSD1306 OLED Display
127
127
  test_files: []
128
+ has_rdoc: