Palatis / arduino-softpwm

Software PWM library for Arduino
78 stars 27 forks source link

DISABLE PWM CHANNEL #9

Closed curlyz closed 7 years ago

curlyz commented 7 years ago

I have used 8A designed for 6 channel PWM+ Servo in 1 pin, unfortunately , . The problem is that it must be dynamic switching mode between PWM and servo for each pin. How would I do that ?

I have try set PWM command to 0 and servo.attach() , not working. Any idea? I think we can work around by setting a function to mask out the channel in SoftPWM::update() ?

Palatis commented 7 years ago

you can't do this. use different pins.

this requires a lot of checking in the ISR, which is against my design principle for this lib.

ahh, you can probably disable timer ISR altogether which sort of pause the whole pwm subsystem.

yes, it disables all softpwm pins.