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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d59e78f9937602e53d10e329fa0a52e0f2e29d6
4
- data.tar.gz: 6d47657f3ca37d372df1c3035003ad6ee84cbd9f
3
+ metadata.gz: 7b96caa1e75f00d7da6cf17d2e032e46751bc504
4
+ data.tar.gz: 13b47b39c5ef6f8bf02dd70fa90a9914f39882ee
5
5
  SHA512:
6
- metadata.gz: db2fc37bcb21cfd3fe809cf32c3b2300f9b5baf322d77c7f3060b64b0830995ae9c5783677511ba798c4674c18807a2c80b7722b046dfd5a9bdabf74274ee433
7
- data.tar.gz: 70a3961c037942c3ed076fe0dbb53a27724174a56f82c07291a2d69e68581826bca9a7847c68b3fd385b977118c5d5cb77acd07c066c106fa80d9b9bd95fa65a
6
+ metadata.gz: 10b31138168058a2c8e9efad77ded45c6042e5943220efeed40328d6de20c7523ec7381924e846b626417e28362d903d69951233b8f73d954d74b289746bd536
7
+ data.tar.gz: be3d31aa7834dbe354d3a4108ca3b1f95e6ad375b162540b341081882de0b1dd169afd3a202951ce52d7eb3b23c33bec8ff5bf60835f1c61f3f549f897a8efb1
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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", 'out'
16
- File.write "/sys/class/gpio/gpio#{id}/direction", 'high'
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpi_pinin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file