You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By using digitalWrite for analogWrite values of zero and 255 the AVR core creates a situation that can cause a glitch.
The solution is simple. Do not treat zero and 255 as special cases. digitalWrite disables PWM so the user can call digitalWrite in the rare circumstances when they want PWM turned off.
The only side-effect is with Fast PWM pins. Instead of a clean "off" there will be a narrow spike for zero.