Tweet
Replying to @josecastillo
Ideally I’d like to use A0’s level as a reference voltage — and as it turns out, a VREF pin (4) is right next to A0! I just made the mistake of assigning it to detecting if we’re on USB power. If I move VBUS_DET to pin 6 and tie pin 4 to A0, I can use A0’s output as a VREF input.
(original)