https://xod.io/libs/awgrover/analog-write-resolution
Gives you access to analogWriteResolution()
. The default PWM is 0…255 (8-bits). You can change this to more bits (on SAMD processors), typically up to 16 bits. Think of it as giving you more divisions between each of the 0…255.
This is not very interesting, for LEDS, for high-values. But, is interesting for low values.
For low-values, it makes fading much smoother. Think of going from 10 to 9 with the default 0…255 range. That’s a 10% change, and is visually noticeably as an large/abrupt brightness change. And it just gets worse: 3 to 4 is a 25% change.
But, if you are using 16 bits, 10 is equivalent to ~ 2570, and going one step to 2569 is 0.038 %. And is not visually noticeable.
With 16-bit, I find that I can do fades all the way down to 0, and not have a noticeable large/abrupt brightness change: i.e. it looks smooth.
In practice, I use a curve where each step is about a 3% change (i.e. “log”). Your mileage may vary.