chipKIT32 / chipKIT-core

Downloadable chipKIT core for use with Arduino 1.6 - 1.8+ IDE, PlatformIO, and UECIDE
http://chipkit.net/
Apache License 2.0
59 stars 53 forks source link

Impliment analogReadResolution() #427

Open JacobChrist opened 6 years ago

JacobChrist commented 6 years ago

Arduino (Zero, Due & MKR Family) has a function that would be useful in chipKIT-core.

analogReadResolution()

Described here:

https://www.arduino.cc/reference/en/language/functions/zero-due-mkr-family/analogreadresolution/

majenkotech commented 6 years ago

Does it actually change the ADC's reading resolution, or just scale it with bit shifting in post processing?

JacobChrist commented 6 years ago

Looks like it just pads with zero's if you set to resolution higher than the chip can handle and probably truncates if the resolution is lowered. Added issue for compatibility completeness.