sunxi_gpio 0.0.3 → 0.0.4
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
- data/README.md +20 -0
- data/ext/sunxi_gpio/extconf.rb +1 -1
- data/lib/sunxi_gpio/pin.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41a03541797f88a175d5cfb495246278d7c012ee
|
4
|
+
data.tar.gz: 9ed2b04036c93156d325b05936fc923c67453245
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6764feff02419af5495fecfca88a5667fbdcb714d58143b908e9ac49e484fefe152f4cbf04b579092dd0aa8858e115a98b1e44eca14457c6ac9d5d4ba6327ad2
|
7
|
+
data.tar.gz: a4d1e92da324fd02a96df7a6c701795eae84a03e75fd20961684f4a354cdc02438a746dc4025e181731356e8c81f5bfb0927e686cf294ae9350e2832bc116b04
|
data/README.md
CHANGED
@@ -19,10 +19,27 @@ gem install sunxi_gpio
|
|
19
19
|
```ruby
|
20
20
|
require 'sunxi_gpio/pin'
|
21
21
|
|
22
|
+
Sunxi::GPIO.open
|
22
23
|
pin = SunxiGPIO::Pin.new(pin: :PB2, direction: :out)
|
23
24
|
pin.on
|
24
25
|
sleep 1
|
25
26
|
pin.off
|
27
|
+
Sunxi::GPIO.close
|
28
|
+
```
|
29
|
+
|
30
|
+
### Simple reading
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
require 'sunxi_gpio/pin'
|
34
|
+
|
35
|
+
Sunxi::GPIO.open
|
36
|
+
pin = SunxiGPIO::Pin.new(pin: :PB2, direction: :in)
|
37
|
+
|
38
|
+
10.times do
|
39
|
+
value = pin.read
|
40
|
+
puts "result: #{value}"
|
41
|
+
sleep 1
|
42
|
+
end
|
26
43
|
```
|
27
44
|
|
28
45
|
|
@@ -31,11 +48,14 @@ pin.off
|
|
31
48
|
```ruby
|
32
49
|
require 'sunxi_gpio/pin'
|
33
50
|
|
51
|
+
Sunxi::GPIO.open
|
34
52
|
pin = SunxiGPIO::Pin.new(pin: :PB2, direction: :out)
|
35
53
|
|
36
54
|
pin.watch do
|
37
55
|
puts "Pin changed from #{last_value} to #{value}"
|
38
56
|
end
|
57
|
+
|
58
|
+
Sunxi::GPIO.close
|
39
59
|
```
|
40
60
|
|
41
61
|
|
data/ext/sunxi_gpio/extconf.rb
CHANGED
data/lib/sunxi_gpio/pin.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunxi_gpio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- phortx
|
@@ -61,6 +61,7 @@ post_install_message:
|
|
61
61
|
rdoc_options: []
|
62
62
|
require_paths:
|
63
63
|
- lib
|
64
|
+
- ext
|
64
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
67
|
- - ">="
|