rupi 0.1.2 → 0.2.0

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.
Files changed (3) hide show
  1. data/lib/rupi/pin.rb +10 -2
  2. data/lib/rupi/version.rb +1 -1
  3. metadata +3 -8
@@ -2,6 +2,13 @@ require 'wiringpi'
2
2
 
3
3
  module Rupi
4
4
  class Pin
5
+
6
+ class GPIO < WiringPi::GPIO
7
+ def pullUpDnControl(pin, pud)
8
+ Wiringpi.pullUpDnControl(pin, pud)
9
+ end
10
+ end
11
+
5
12
  attr_reader :number, :up_handlers, :down_handlers
6
13
 
7
14
  def initialize(number)
@@ -16,11 +23,12 @@ module Rupi
16
23
  end
17
24
 
18
25
  def self.gpio
19
- @gpio ||= WiringPi::GPIO.new
26
+ @gpio ||= GPIO.new
20
27
  end
21
28
 
22
- def input!
29
+ def input!(pud = PUD_DOWN)
23
30
  gpio.mode(number, INPUT)
31
+ gpio.pullUpDnControl(number, pud) if pud
24
32
  end
25
33
 
26
34
  def output!
@@ -1,3 +1,3 @@
1
1
  module Rupi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rupi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
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: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2012-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: wiringpi
@@ -86,18 +86,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
86
  - - ! '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
- segments:
90
- - 0
91
- hash: -4180920324763332401
92
89
  required_rubygems_version: !ruby/object:Gem::Requirement
93
90
  none: false
94
91
  requirements:
95
92
  - - ! '>='
96
93
  - !ruby/object:Gem::Version
97
94
  version: '0'
98
- segments:
99
- - 0
100
- hash: -4180920324763332401
101
95
  requirements: []
102
96
  rubyforge_project:
103
97
  rubygems_version: 1.8.24
@@ -106,3 +100,4 @@ specification_version: 3
106
100
  summary: Provides a very natural ruby interface for interacting with GPIO on the Raspberry
107
101
  Pi
108
102
  test_files: []
103
+ has_rdoc: