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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13c9033952c730a81a3bc76e0033d3f3389b0a09
4
- data.tar.gz: b375773d796520cad8d1b4171cbc2156eddfe8a3
3
+ metadata.gz: 95205e0c301a261a683cf3bb5dde72c7210a4d80
4
+ data.tar.gz: c6cce65f85343fb24d90eef779425ba3b490fa4d
5
5
  SHA512:
6
- metadata.gz: aa648dfe4a33da3ab53a2d98d913dfa0b761b27d396b2c37ea2f946f10562890eca6f4e2dc7e17ff06c1d42b5b227961e641972217ac7139373f76caf486f881
7
- data.tar.gz: 6462cbfb7a1f4dd27d9701bbf1173e9c104962d6f11d53977886f72f55baeef1cff4a62e8d3cba8a810073f52e748fa663207d9840c544b9232dc0d97a7965b2
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.0
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-03 00:00:00.000000000 Z
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