simple_raspberrypi 0.2.1 → 0.2.2
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/simple_raspberrypi.rb +6 -6
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c10213e2e161b65f1ac59ce24aabe0b26e04394
|
4
|
+
data.tar.gz: 81c37070b4dad7f9fbb9fed39acba1ecd444b598
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca1e7b6524bae5fa119803ba840d347d6c74027629ea6c26fa4a968d61df6c08771454fb6cf3c9f5bcebe262fe361a00d76ff1c455788d4500b3842ffb075629
|
7
|
+
data.tar.gz: 2dfa0cdc5be7aa82b5dfe82918401d694f8173d644b33f694734be19e9f59f9f05422eb2db856db0548adce13820dee4682c15bcf71da05f427d06baeb0f149f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/simple_raspberrypi.rb
CHANGED
@@ -90,7 +90,7 @@ class SimpleRaspberryPi
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def initialize(x=[])
|
93
|
-
|
93
|
+
|
94
94
|
RPi::GPIO.set_numbering :bcm
|
95
95
|
|
96
96
|
a = case x
|
@@ -101,10 +101,9 @@ class SimpleRaspberryPi
|
|
101
101
|
when Array
|
102
102
|
x
|
103
103
|
end
|
104
|
-
|
105
|
-
unexport_all a
|
106
104
|
|
107
|
-
|
105
|
+
|
106
|
+
@pins = a.map {|pin| PinX.new pin.to_i }
|
108
107
|
|
109
108
|
def @pins.[](i)
|
110
109
|
|
@@ -121,7 +120,8 @@ class SimpleRaspberryPi
|
|
121
120
|
# to avoid "Device or resource busy @ fptr_finalize - /sys/class/gpio/export"
|
122
121
|
# we unexport the pins we used
|
123
122
|
|
124
|
-
unexport_all a
|
123
|
+
#unexport_all a
|
124
|
+
RPi::GPIO.reset
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
@@ -155,4 +155,4 @@ if __FILE__ == $0 then
|
|
155
155
|
# example
|
156
156
|
my_rpi = SimpleRaspberryPi.new %w(17 22 18 4 23 25 27) # <-- each pin connects to an LED
|
157
157
|
my_rpi.pins[ARGV.first.to_i].method(ARGV.last.to_sym).call
|
158
|
-
end
|
158
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
���*~X��B\�q'��;��N9��6z��m��u��ޚ̲(�p8;l��n��'��Љ��2��H2�=���@��mp+��� �æ���濎�&�5t���H}_��@�e�J*�-�Bn4Dޗ�5DS� I|�t�`��#�G�Xx���>Aӹ�,i�O�������$�\X�U�l�4�M�{&卶f�Nw>����Y
|
2
|
+
��&���y�� B]��k-��1<x���gW,����ĥZ����b'YDsZvwj[�
|