rpi 0.1.2 → 0.2.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 +20 -1
- metadata +17 -18
- 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: 23287a8198e3f7fd172c1fe4fb01566c1186dc04
|
4
|
+
data.tar.gz: 81c585ef7df7d192f8a4f91a4aacdf713490cd97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 783a49e803dcd7fe0f32569f02a7e6903ae52822f64eb50fc45242b4a3ee16e4ce4769640567d33edec52ccb304076158c11a5299abac0ac11c1de270c1ce23c
|
7
|
+
data.tar.gz: 9e8374d93a8ae3d5f96bf607bb202e3f5124f668690a4a28cf487fd58b294e2a894734a4b1e06c73a7b54dc736ee32328305218b6beb447ba454ece1630ca213
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rpi.rb
CHANGED
@@ -7,6 +7,8 @@ require 'pi_piper'
|
|
7
7
|
|
8
8
|
class RPi
|
9
9
|
include PiPiper
|
10
|
+
|
11
|
+
@leds = []
|
10
12
|
|
11
13
|
class Led < Pin
|
12
14
|
|
@@ -62,10 +64,27 @@ class RPi
|
|
62
64
|
end
|
63
65
|
|
64
66
|
def initialize(a=[])
|
67
|
+
|
65
68
|
@leds = a.map {|pin| Led.new pin }
|
69
|
+
|
70
|
+
at_exit do
|
71
|
+
|
72
|
+
# to avoid "Device or resource busy @ fptr_finalize - /sys/class/gpio/export"
|
73
|
+
# we unexport the pins we used
|
74
|
+
|
75
|
+
a.each do |pin|
|
76
|
+
|
77
|
+
uexp = open("/sys/class/gpio/unexport", "w")
|
78
|
+
uexp.write(pin)
|
79
|
+
uexp.close
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
66
83
|
end
|
67
84
|
|
68
85
|
def led() @leds end
|
86
|
+
|
87
|
+
|
69
88
|
end
|
70
89
|
|
71
90
|
|
@@ -73,4 +92,4 @@ if __FILE__ == $0 then
|
|
73
92
|
# example
|
74
93
|
my_rpi = RPi.new %w(17 22 18 4 23 25 27) # <-- each pin connects to an LED
|
75
94
|
my_rpi.led[ARGV.first.to_i].method(ARGV.last.to_sym).call
|
76
|
-
end
|
95
|
+
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.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE1MDIxNTEzMTM0N1oXDTE2MDIxNTEzMTM0N1owSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
ggEBALEQ7boV6HaYVcpkq7YXoOaVVbs3d4LibKn9C8QsdpRPX2d99A/U/HA0Knkq
|
19
|
+
6zHSh7dw71jAfVaf9sRCVeu3tXKAfBFfhSkde9ScN2T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
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: pi_piper
|
@@ -85,4 +85,3 @@ signing_key:
|
|
85
85
|
specification_version: 4
|
86
86
|
summary: The RPi gem makes it easy to set blinking LEDs on the Raspberry Pi
|
87
87
|
test_files: []
|
88
|
-
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|