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
5
5
include Behaviors ::Threaded
6
6
7
7
def after_initialize ( options = { } )
8
+ options [ :mode ] = :output_pwm
8
9
super ( options )
9
10
@min = options [ :min ] || 544
10
11
@max = options [ :max ] || 2400
Original file line number Diff line number Diff line change 1
1
module Denko
2
2
module PulseIO
3
3
class Buzzer < PWMOutput
4
+ def initialize_pins ( options = { } )
5
+ options [ :mode ] = :output_pwm
6
+ super ( options )
7
+ end
8
+
4
9
def after_initialize ( options = { } )
5
10
low
6
11
end
Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ module PulseIO
3
3
class IRTransmitter
4
4
include Behaviors ::OutputPin
5
5
6
+ def initialize_pins ( options = { } )
7
+ options [ :mode ] = :output_pwm
8
+ super ( options )
9
+ end
10
+
6
11
def emit ( pulses = [ ] , frequency : 38 )
7
12
if pulses . length > 256 || pulses . length < 1
8
13
raise ArgumentError , 'wrong number of IR pulses (expected 1 to 256)'
You can’t perform that action at this time.
0 commit comments