arduino / arduino/ArduinoCore-avr

Don't give special treatment of 0 and 255 in Arduino AVR Boards' analogWrite()

Open
#170 5 comments 0 reactions 1 assignee Claimed by @cmaglie View on GitHub
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

http://forum.arduino.cc/index.php?topic=303922.0

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.