Skip to content

Commit a6645ee

Browse files
committed
Servo Buzzer and IRTransmitter should start in :output_pwm
1 parent 6a0cdd1 commit a6645ee

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

lib/denko/motor/servo.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

lib/denko/pulse_io/buzzer.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
module 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

lib/denko/pulse_io/ir_transmitter.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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)'

0 commit comments

Comments
 (0)