i2c-alpha_display 0.3.0 → 0.5.1

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: 96460488d5fdec071a77578a458f1debd8be3e34
4
- data.tar.gz: 9eb8700402b0c86185aff32ba76611d553b81b76
3
+ metadata.gz: 9828a14d69342a831f7df3209d96dd2d6727680a
4
+ data.tar.gz: 4c988f531822a24e20c0c7a5bbd520f6eaaf7a39
5
5
  SHA512:
6
- metadata.gz: 24aae001a71f39fe9d8c87bdeea06bb30321583ee7557629a03317e986fd1822fb9854887d7270da0b622ec39bdbf6043bbe3f2a239e76e1180cca97d0205997
7
- data.tar.gz: 0e73ba3b30ad116cc58858545703981ba089739df8944450f118fe75a58166fdc855696d21416185d7ea9382f7cb60f38f66d1d4ddfe7f812afbb96ce5fc8c90
6
+ metadata.gz: 0c687cf847f27a65f72b6f862dfa6ae6a3b4d60694d2ee893579e1c0618df95a919423d0d468ba4b142dc99ecebaf14c97ddf96cfdec56efa7f40e2db710af70
7
+ data.tar.gz: 9bcf1aa5d23046ca019ef8cb0b76593eedc79f612f353e0cb000087887e958ef3399bf5895092a9fc50f3accd65426a80b2c3a91365b94039cc1aea743baaec9
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # I2c::AlphaDisplay
1
+ # I2C::AlphaDisplay
2
+
3
+ A command line gem to make it easy to send data to I2C 7 and 14-segment displays, like this one: https://www.adafruit.com/product/881
2
4
 
3
5
  ## Installation
4
6
 
@@ -6,6 +8,12 @@
6
8
 
7
9
  ## Usage
8
10
 
11
+ After installing the gem pipe any output to `i2cdisp` and it will do its best to show it on the display. Numberic input will have suffixes added so as much fits as possible. Eg. `12345` => `12.3k`
12
+
13
+ $ echo helo | i2cdisp
14
+
15
+ ![14-segment display](./display.jpg)
16
+
9
17
  ## License
10
18
 
11
19
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Binary file
File without changes
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- #spec.add_dependency "wiringpi2"
23
+ spec.add_dependency "wiringpi2"
24
+ spec.add_dependency "trollop"
24
25
  spec.add_development_dependency "bundler", "~> 1.13"
25
26
  spec.add_development_dependency "rake", "~> 10.0"
26
27
  end
@@ -1,5 +1,5 @@
1
1
  module I2C
2
2
  class AlphaDisplay
3
- VERSION = "0.3.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
@@ -1,10 +1,16 @@
1
-
1
+ require 'trollop'
2
2
  require 'i2c/alpha_display'
3
3
 
4
4
  module I2C
5
5
  class AlphaDisplayApp
6
6
  def main
7
- @display = AlphaDisplay.new(0x70)
7
+ opts = Trollop::options do
8
+ version "i2c-disp #{AlphaDisplay::VERSION} (c) 2016 @reednj (reednj@gmail.com)"
9
+ banner "Usage: i2c-disp [options]"
10
+ opt :device, "I2C device id for the display", :type => :integer, :default => 0x70
11
+ end
12
+
13
+ @display = AlphaDisplay.new(opts[:device])
8
14
 
9
15
  STDIN.each_line do |line|
10
16
  begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i2c-alpha_display
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Reed
@@ -10,6 +10,34 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: wiringpi2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: trollop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: bundler
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -42,7 +70,7 @@ description:
42
70
  email:
43
71
  - reednj@gmail.com
44
72
  executables:
45
- - i2c-disp
73
+ - i2cdisp
46
74
  extensions: []
47
75
  extra_rdoc_files: []
48
76
  files:
@@ -54,7 +82,8 @@ files:
54
82
  - Rakefile
55
83
  - bin/console
56
84
  - bin/setup
57
- - exe/i2c-disp
85
+ - display.jpg
86
+ - exe/i2cdisp
58
87
  - i2c-alpha_display.gemspec
59
88
  - lib/i2c/alpha_display.rb
60
89
  - lib/i2c/alpha_display/extensions.rb