The chip is the ATSAMD21 (http://ww1.microchip.com/downloads/en/DeviceDoc/40001882A.pdf)
It uses an internal ADC. I am using the logic voltage as my reference so AREF is not set, making that 3.3v, or more precisely, 3.27v. The pins directly next to the analog pins I am using are also used for other purposes, so they are not always connected to ground. Hopefully the values are consistent and I can compensate in software.
Thanks,
Tyler
How do you connect your logic voltage (3.3V nominal) to your Vref? I would recommend to use a zener diode or linear voltage regulator. Those are stable, meaning low noise on the reference voltage. When you don't have a higher voltage (to use a zener or regulator), connect it directly to the VCC pin of your controller, and put a 100nF decoupling capacitor withing a close range of the Vref pin.
They also have gain and offset correction registers which can be used to further improve ADC accuracy. It's up to the user to provide the correct values for these registers, which may be used to a certain extent to calibrate for external hardware as well as variation between different MCUs.
If you are a beginner or don't like to program, I would recommend to use the libraries for that, but I find that these libraries have a decent amount of overhead. Not that the library isn't good, it is very efficient, but it will never be as good as writing your own code, specific for your uses. So when you have big programs, running almost to the maximum space inside your microcontroller, I would recommend to write it yourself.
It may be helpful to show your schematic.
If you have specific questions on how to implement it, a schematic would be helpfull... I can only provide as much info as you are telling me
Or your code can help too... But I think you can do it, (I believe that)
Greets,
Lovely Santa