rpi_pinin 0.1.1 → 0.1.2
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_pinin.rb +7 -3
- metadata +1 -1
- 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: 7b96caa1e75f00d7da6cf17d2e032e46751bc504
|
4
|
+
data.tar.gz: 13b47b39c5ef6f8bf02dd70fa90a9914f39882ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b31138168058a2c8e9efad77ded45c6042e5943220efeed40328d6de20c7523ec7381924e846b626417e28362d903d69951233b8f73d954d74b289746bd536
|
7
|
+
data.tar.gz: be3d31aa7834dbe354d3a4108ca3b1f95e6ad375b162540b341081882de0b1dd169afd3a202951ce52d7eb3b23c33bec8ff5bf60835f1c61f3f549f897a8efb1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rpi_pinin.rb
CHANGED
@@ -6,14 +6,18 @@
|
|
6
6
|
|
7
7
|
class RPiPinIn
|
8
8
|
|
9
|
-
def initialize(id)
|
9
|
+
def initialize(id, pull: nil)
|
10
10
|
|
11
11
|
@id = id
|
12
12
|
unexport()
|
13
13
|
|
14
14
|
File.write '/sys/class/gpio/export', id
|
15
|
-
File.write "/sys/class/gpio/gpio#{id}/direction", '
|
16
|
-
|
15
|
+
File.write "/sys/class/gpio/gpio#{id}/direction", 'in'
|
16
|
+
|
17
|
+
case pull
|
18
|
+
when :up
|
19
|
+
File.write "/sys/class/gpio/gpio#{id}/direction", 'high'
|
20
|
+
end
|
17
21
|
|
18
22
|
at_exit { unexport() }
|
19
23
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|