rpi 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/rpi.rb +20 -1
  5. metadata +17 -18
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f00ccbd72c5f650be889cd47a5e8b8de5bb68854
4
- data.tar.gz: 5241c76f19966169d94253117770e42dca7233f7
3
+ metadata.gz: 23287a8198e3f7fd172c1fe4fb01566c1186dc04
4
+ data.tar.gz: 81c585ef7df7d192f8a4f91a4aacdf713490cd97
5
5
  SHA512:
6
- metadata.gz: cc64a7eb4d80f0a6127741b256bfa35b263ec08434461e0f8987f664bbb67d07fa00f6d20eda4a91680e2f40fb8dd5d9742f2c47e98a42d38001520a33827af9
7
- data.tar.gz: 758608c536f9fe26d79e2b6f015fe336ca0b4ed987ed06de801116193ca8f84574b4f5b04019bbc4a0348f4ca30b7d01f707d1e6af89f0d27c46d2404422e1b4
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.1.2
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
- 8ixkARkWAmV1MB4XDTEzMTEyNDIwMDcyNFoXDTE0MTEyNDIwMDcyNFowSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE1MDIxNTEzMTM0N1oXDTE2MDIxNTEzMTM0N1owSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBALCGFRGqa6ERfIxEGvd0JriUpNdXs6QiKo+3UC1VxChYHoAH3g7lsf+a3VHo
19
- xcKJf77nUgWEXHnIuN0cTFDi482kyly/Bk5dC5URfI1CF61Bo6WxtqOWewsfF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qaChNRwKT77nNxE4A66r43FAsMigA9loCCBfP1pfMch+6
29
- d3G2UHZZptFiapmTIX/3dwb87+dVlxUHBvedWDT/6jhyfKSahTGl1HmvJw/eT/eZ
30
- ym7xsGYO7YI1zUiobudJMBslpg9Kgm2ooaFiizTHShcZNx6jUBjCnF8zQ/WREMDa
31
- lQvI6/bR+gvrxxIYGY/VLrsSxXasTQAOxICwewAx186W0aVXdfHtujoUBYHbuutl
32
- 2yqX2uRxfgCriQ==
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAW99/XMl8
27
+ VKE8hMIUlglFKL/Pm2rPc49iy+Nc/dUfzkXr0sHgpcAFkrEwQNn4nnmSgnegyq0n
28
+ qNZSSzBjtoQHWkngKEWBZBAu6dPTpOqCrKzsAqY2V9y6/0Uf3QyPf1ynlj9I6dix
29
+ pSMb0uwflV43ZrMdHR+Ih8//vJouSN6OFTEjAf+saEvieEbRpdNPFQDWLZ+yrVfp
30
+ 7Kd/h1AjyNC3iDpvnyxKOsF9KlR7X6JrXgjyX1Y0qPfWy0jPuo3Fm/djRGtl1ENC
31
+ Wx7qSZTfBXcuGk2ymZ2BpCgaIse2YK04JVIWsaTEFsbO44uMfK+sRtGmTmyf/12f
32
+ KzQM/zlgQa5pBA==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-07-09 00:00:00.000000000 Z
34
+ date: 2015-02-15 00:00:00.000000000 Z
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