pi_piper 1.2 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Manifest +1 -0
  2. data/README.md +7 -21
  3. data/Rakefile +2 -2
  4. data/pi_piper.gemspec +3 -3
  5. metadata +3 -3
data/Manifest CHANGED
@@ -6,3 +6,4 @@ lib/pi_piper/bcm2835.rb
6
6
  lib/pi_piper/libbcm2835.img
7
7
  lib/pi_piper/pin.rb
8
8
  lib/pi_piper/spi.rb
9
+ pi_piper.gemspec
data/README.md CHANGED
@@ -27,28 +27,14 @@ pin.off
27
27
  ```
28
28
 
29
29
  ### SPI
30
- Starting with version 1.2, PiPiper offers SPI support. Before utilizing SPI, ensure that you have Mike McCauley's [bcm2835 library](http://www.open.com.au/mikem/bcm2835/index.html) installed:
31
-
32
- ls /usr/local/lib/libbcm2835.so
33
-
34
- If that file is not present, and you try to utilize the PiPiper::Spi class, you will receive an error similar to:
35
-
36
- LoadError: Could not open library '/usr/local/lib/libbcm2835.so': /usr/local/lib/libbcm2835.so: cannot open shared object file: No such file or directory
37
- from /var/lib/gems/1.9.1/gems/ffi-1.3.1/lib/ffi/library.rb:123:in `block in ffi_lib'
38
- from /var/lib/gems/1.9.1/gems/ffi-1.3.1/lib/ffi/library.rb:90:in `map'
39
- from /var/lib/gems/1.9.1/gems/ffi-1.3.1/lib/ffi/library.rb:90:in `ffi_lib'
40
- from /var/lib/gems/1.9.1/gems/pi_piper-1.2/lib/pi_piper/bcm2835.rb:6:in `<module:Bcm2835>'
41
- from /var/lib/gems/1.9.1/gems/pi_piper-1.2/lib/pi_piper/bcm2835.rb:4:in `<module:PiPiper>'
42
- from /var/lib/gems/1.9.1/gems/pi_piper-1.2/lib/pi_piper/bcm2835.rb:3:in `<top (required)>'
43
- from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
44
- from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
45
- from /var/lib/gems/1.9.1/gems/pi_piper-1.2/lib/pi_piper/spi.rb:261:in `initialize'
46
- from (irb):2:in `new'
47
- from (irb):2
48
- from /usr/bin/irb:12:in `<main>'
49
-
50
- For those uninterested in SPI support, the bcm2835 is a "soft" requirement and is lazy loaded. If you never intended to use PiPiper::Spi, you shouldn't have to worry about this requirement.
30
+ Starting with version 1.2, Pi Piper offers SPI support.
51
31
 
32
+ ```ruby
33
+ PiPiper::Spi.begin do |spi|
34
+ raw = spi.write [1, (8+adc_num)<<4, 0]
35
+ value = ((raw[1]&3) << 8) + raw[2]
36
+ end
37
+ ```
52
38
 
53
39
 
54
40
  ## Example projects
data/Rakefile CHANGED
@@ -2,13 +2,13 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('pi_piper', '1.2') do |p|
5
+ Echoe.new('pi_piper', '1.2.1') do |p|
6
6
  p.description = "Event driven Raspberry Pi GPIO library"
7
7
  p.url = "http://github.com/jwhitehorn/pi_piper"
8
8
  p.author = "Jason Whitehorn"
9
9
  p.email = "jason.whitehorn@gmail.com"
10
10
  p.ignore_pattern = ["examples/**/*"]
11
- p.development_dependencies = ['ffi']
11
+ p.dependencies = ['ffi']
12
12
  end
13
13
 
14
14
  Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
data/pi_piper.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "pi_piper"
5
- s.version = "1.2"
5
+ s.version = "1.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jason Whitehorn"]
9
- s.date = "2013-01-21"
9
+ s.date = "2013-01-22"
10
10
  s.description = "Event driven Raspberry Pi GPIO library"
11
11
  s.email = "jason.whitehorn@gmail.com"
12
12
  s.extra_rdoc_files = ["README.md", "lib/pi_piper.rb", "lib/pi_piper/bcm2835.rb", "lib/pi_piper/libbcm2835.img", "lib/pi_piper/pin.rb", "lib/pi_piper/spi.rb"]
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.specification_version = 3
23
23
 
24
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- s.add_development_dependency(%q<ffi>, [">= 0"])
25
+ s.add_runtime_dependency(%q<ffi>, [">= 0"])
26
26
  else
27
27
  s.add_dependency(%q<ffi>, [">= 0"])
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pi_piper
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-21 00:00:00.000000000 Z
12
+ date: 2013-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -19,7 +19,7 @@ dependencies:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
- type: :development
22
+ type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false