File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ class Servo
55 include Behaviors ::Threaded
66
77 def after_initialize ( options = { } )
8+ options [ :mode ] = :output_pwm
89 super ( options )
910 @min = options [ :min ] || 544
1011 @max = options [ :max ] || 2400
Original file line number Diff line number Diff line change 11module Denko
22 module PulseIO
33 class Buzzer < PWMOutput
4+ def initialize_pins ( options = { } )
5+ options [ :mode ] = :output_pwm
6+ super ( options )
7+ end
8+
49 def after_initialize ( options = { } )
510 low
611 end
Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ module PulseIO
33 class IRTransmitter
44 include Behaviors ::OutputPin
55
6+ def initialize_pins ( options = { } )
7+ options [ :mode ] = :output_pwm
8+ super ( options )
9+ end
10+
611 def emit ( pulses = [ ] , frequency : 38 )
712 if pulses . length > 256 || pulses . length < 1
813 raise ArgumentError , 'wrong number of IR pulses (expected 1 to 256)'
You can’t perform that action at this time.
0 commit comments