analogWriteResolution applied to DAC

Jake

Well-known member
With the Teensy 3.1 having a 12 bit DAC, I assumed that I would need to send a number from zero to 2^12-1 to it. This worked well until I also started using PWM and changed its default resolution using the analogWriteResolution command.

If I sent analogWriteResolution(N); then the number I send to the DAC needs to be between zero and 2^N-1.

This caused confusion until I figured it out.

I am not sure why the DAC resolution should be tied to the PWM resolution, so would consider this a bug.
 
Back
Top