The product description for Feather M4 CAN SAME51 claims the analog inputs are 12-bit. A 12-bit input should have a range of values from 0 to 4095. But I discovered that my device only supports a range of values from 0 to 1023 (10-bit). Conversion of ADC to voltage is then as follows:
uint16_t adc = analogRead(A0);
float f = (float)adc * (3.3/1023); // 3.3 volts, 0 to 1023 ADC range
Feather M4 CAN SAME51 analog input 1023 not 4095
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mkiehl
- Posts: 23
- Joined: Mon Oct 08, 2012 1:03 pm
- adafruit_support_bill
- Posts: 88088
- Joined: Sat Feb 07, 2009 10:11 am
Re: Feather M4 CAN SAME51 analog input 1023 not 4095
AnalogRead() in the Arduino library defaults to 10 bit resolution for backwards compatibility with older boards. You can change that with the AnalogReadResolution() function.
https://www.arduino.cc/reference/en/lan ... esolution/
https://www.arduino.cc/reference/en/lan ... esolution/
Please be positive and constructive with your questions and comments.