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?


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.

  • 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! – user20985 May 12 '16 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy