rpi 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rpi.rb +8 -8
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e507a5b6ed7cf1e8944666d7f461be765e145fad
|
4
|
+
data.tar.gz: 6eccc0669846eb43d45efc0f60238a63e87d4f18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432e9f41f6610f7eee5cd691fbb8402c095d8ff33106c2573133dd60762c4aa97d47a58b82dc6a5cda1a34c1485fcd7bb2cea381318ae011e540fce03ae84bc4
|
7
|
+
data.tar.gz: 32d832215f1899394913fb5ebe0922e3340a5dd65a79fe563a267e8d24f2597d432394fe56b83d4412e3669159158d5c24d29942fd19fe91bce28f9deda2e7e2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rpi.rb
CHANGED
@@ -10,7 +10,7 @@ class RPi
|
|
10
10
|
|
11
11
|
@leds = []
|
12
12
|
|
13
|
-
class
|
13
|
+
class PinX < Pin
|
14
14
|
|
15
15
|
HIGH = 1
|
16
16
|
LOW = 0
|
@@ -78,12 +78,12 @@ class RPi
|
|
78
78
|
|
79
79
|
unexport_all a
|
80
80
|
|
81
|
-
@
|
81
|
+
@pins = a.map {|pin| PinX.new pin }
|
82
82
|
|
83
|
-
def @
|
83
|
+
def @pins.[](i)
|
84
84
|
|
85
85
|
if i.to_i >= self.length then
|
86
|
-
puts "RPi warning:
|
86
|
+
puts "RPi warning: PinX instance #{i.inspect} not found"
|
87
87
|
Void.new
|
88
88
|
else
|
89
89
|
self.at(i)
|
@@ -99,7 +99,7 @@ class RPi
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
def
|
102
|
+
def pins() @pins end
|
103
103
|
|
104
104
|
def unexport_all(pins)
|
105
105
|
|
@@ -115,7 +115,7 @@ class RPi
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def on_exit
|
118
|
-
unexport_all @
|
118
|
+
unexport_all @pins
|
119
119
|
end
|
120
120
|
|
121
121
|
def self.unexport(a)
|
@@ -133,5 +133,5 @@ end
|
|
133
133
|
if __FILE__ == $0 then
|
134
134
|
# example
|
135
135
|
my_rpi = RPi.new %w(17 22 18 4 23 25 27) # <-- each pin connects to an LED
|
136
|
-
my_rpi.
|
137
|
-
end
|
136
|
+
my_rpi.pins[ARGV.first.to_i].method(ARGV.last.to_sym).call
|
137
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Wx7qSZTfBXcuGk2ymZ2BpCgaIse2YK04JVIWsaTEFsbO44uMfK+sRtGmTmyf/12f
|
32
32
|
KzQM/zlgQa5pBA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-09-26 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: pi_piper
|
metadata.gz.sig
CHANGED
Binary file
|