3

I want to generate a PWM signal that I can turn on and off with a button press without using interrupts. Is there a way to keep the PWM output going while running other processes?

asked May 12, 2016 at 0:25

1 Answer 1

4

PWM just runs once started. It's all managed by a completely separate bit of silicon inside the chip.

Once you have done analogWrite(...) the PWM will just keep going until you tell it otherwise.

answered May 12, 2016 at 0:30
1
  • I was running this with Serial plotter yesterday and for some reason it kept interrupting the PWM when I was reading one of the analog channels. I finally tested on an oscilloscope and it does work. Thanks! Commented May 12, 2016 at 17:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.