sunxi_gpio 0.0.3 → 0.0.4

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: 6c50611c24ebb118b677a76ef041ec5e26a65faf
4
- data.tar.gz: 7743b9dce6dcabc6ce586d3734c832caa745ce53
3
+ metadata.gz: 41a03541797f88a175d5cfb495246278d7c012ee
4
+ data.tar.gz: 9ed2b04036c93156d325b05936fc923c67453245
5
5
  SHA512:
6
- metadata.gz: 7cda901080750937c67c20de0155891e4694ed3928485bfe168f8030ce798e3a4359dc6ec97809463a1cea422fd49b0c7ccc1e3d3915ae6122221ca0d4d5b955
7
- data.tar.gz: 9bdc783d08856e7f83ce8ed4c1dd3f4060d8a93bdfe700c4fc239ec19e533019af4772e52a328f538e7dad54077a2fd56375697998865f64593a0e64a14ef44f
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
 
@@ -1,3 +1,3 @@
1
1
  require 'mkmf'
2
2
 
3
- create_makefile 'sunxi_gpio'
3
+ create_makefile 'gpio_lib'
@@ -1,4 +1,4 @@
1
- require 'sunxi-gpio/gpio_lib'
1
+ require 'sunxi_gpio/gpio_lib'
2
2
  require 'sunxi_gpio/pin_values'
3
3
 
4
4
  module SunxiGPIO
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.3
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
  - - ">="