rpi_pwm 0.2.0 → 0.2.1
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_pwm.rb +14 -1
- metadata +2 -2
- 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: 95205e0c301a261a683cf3bb5dde72c7210a4d80
|
4
|
+
data.tar.gz: c6cce65f85343fb24d90eef779425ba3b490fa4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84e91340a5b6c41c2e0b49f4ae510b4c78eb9f746bf0938bf4e66804bad9b54d23e2c5290dd0f1fad4aa12803c9ed545d19df031e254e3d36953b2743f33b509
|
7
|
+
data.tar.gz: 1ae48d835dbc86adf954780ab6b8e84c93439097311a5f860d3bcbae8bb143e481e4b8ce64f857522f298ef6f705dcb110c2df7c90adb262aca56764257f5cb3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rpi_pwm.rb
CHANGED
@@ -27,11 +27,20 @@ class RPiPwm
|
|
27
27
|
at_exit { RPi::GPIO.clean_up pin_num}
|
28
28
|
|
29
29
|
end
|
30
|
+
|
31
|
+
def blinking?()
|
32
|
+
@blinking
|
33
|
+
end
|
30
34
|
|
31
35
|
def duty_cycle=(val)
|
32
36
|
@duty_cycle = val
|
33
37
|
@pwm.duty_cycle = val
|
34
38
|
end
|
39
|
+
|
40
|
+
def freq=(val)
|
41
|
+
@freq = val
|
42
|
+
@pwm.frequency = val
|
43
|
+
end
|
35
44
|
|
36
45
|
def on(durationx=nil, duration: nil)
|
37
46
|
|
@@ -59,9 +68,12 @@ class RPiPwm
|
|
59
68
|
|
60
69
|
alias stop off
|
61
70
|
alias start on
|
71
|
+
alias frequency freq
|
62
72
|
|
63
73
|
def blink(seconds=0.5, duration: nil)
|
64
|
-
|
74
|
+
|
75
|
+
self.stop if blinking?
|
76
|
+
|
65
77
|
@blinking = true
|
66
78
|
t2 = Time.now + duration if duration
|
67
79
|
|
@@ -98,6 +110,7 @@ class RPiPwm
|
|
98
110
|
|
99
111
|
if val then
|
100
112
|
@pwm.start @duty_cycle
|
113
|
+
@pwm.frequency = @freq
|
101
114
|
else
|
102
115
|
@pwm.stop
|
103
116
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpi_pwm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Lg+1iD44mOhKo89xZ5h1Puu6JavsbMTmeFCxBH7BbacQ3NHjj3CSG0pI0YWlDSys
|
32
32
|
SKOkTuZCEwtqtw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-04-
|
34
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rpi_gpio
|
metadata.gz.sig
CHANGED
Binary file
|