pigpio 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,25 +1,33 @@
1
1
  require_relative "./gpio"
2
- class Pigpio::UserGPIO < Pigpio::GPIO
3
- IF=Pigpio::IF
4
- def watchdog(timeout)
5
- ret=IF.set_watchdog(@pi,@gpio,timeout)
2
+ class Pigpio
3
+ class UserGPIO < GPIO
4
+ def watchdog(timeout)
5
+ ret=IF.set_watchdog(@pi,@gpio,timeout)
6
+ end
7
+ def glitch_filter(steady)
8
+ ret=IF.set_glitch_filter(@pi,@gpio,steady)
9
+ end
10
+ def noise_filter(steady,active)
11
+ ret=IF.set_noise_filter(@pi,@gpio,steady,active)
12
+ end
13
+ def callback(edge,&blk)
14
+ return nil unless blk
15
+ q=NativeQueue.make
16
+ th=Thread.start do
17
+ while resource = q.pop
18
+ blk.call(*resource)
19
+ end
20
+ end
21
+ IF.callback(@pi,@gpio,edge,q,th)
22
+ end
23
+ def wait_for_edge(edge,timeout)
24
+ ret=IF.wait_for_edge(@pi,@gpio,edge,timeout)
25
+ end
26
+ def trigger(pulseLen,level)
27
+ ret=IF.gpio_trigger(@pi,@gpio,pulseLen,level)
28
+ end
29
+ def pwm
30
+ PWM.new(@pi,@gpio)
31
+ end
6
32
  end
7
- def glitch_filter(steady)
8
- ret=IF.set_glitch_filter(@pi,@gpio,steady)
9
- end
10
- def noise_filter(steady,active)
11
- ret=IF.set_noise_filter(@pi,@gpio,steady,active)
12
- end
13
- def callback(edge,&blk)
14
- IF.callback(@pi,@gpio,edge,&blk)
15
- end
16
- def wait_for_edge(edge,timeout)
17
- ret=IF.wait_for_edge(@pi,@gpio,edge,timeout)
18
- end
19
- def trigger(pulseLen,level)
20
- ret=IF.gpio_trigger(@pi,@gpio,pulseLen,level)
21
- end
22
- def pwm
23
- PWM.new(@pi,@gpio)
24
- end
25
- end
33
+ end
@@ -1,3 +1,3 @@
1
1
  class Pigpio
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pigpio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - nak1114
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-15 00:00:00.000000000 Z
11
+ date: 2019-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,6 +88,10 @@ files:
88
88
  - bin/docker.rb
89
89
  - bin/setup
90
90
  - check.txt
91
+ - example/simple/board.svg
92
+ - example/simple/callback.rb
93
+ - example/simple/pwm.rb
94
+ - example/simple/readme.md
91
95
  - ext/pigpio/extconf.rb
92
96
  - ext/pigpio/pigpio.c
93
97
  - lib/pigpio.rb