How to use the built in 1V1 reference?
Posted: Thu Apr 18, 2019 12:40 pm
Hello,
I would like to take a voltage reading with one of the ADC pins via analogRead.
By default ESP32 uses whatever its current + rail voltage is as a reference,if I am not mistaken.
However, I need to use the built in 1V1 reference instead.
On arduino, this is very easy, I simply do this:
analogReference(INTERNAL);
And thats it. All analogReads now use the built in 1V1 as reference.
This code however, will not compile on the ESP32. So how do I set the ADC on the esp32 to use the built in 1V1 reference instead?
thank you
I would like to take a voltage reading with one of the ADC pins via analogRead.
By default ESP32 uses whatever its current + rail voltage is as a reference,if I am not mistaken.
However, I need to use the built in 1V1 reference instead.
On arduino, this is very easy, I simply do this:
analogReference(INTERNAL);
And thats it. All analogReads now use the built in 1V1 as reference.
This code however, will not compile on the ESP32. So how do I set the ADC on the esp32 to use the built in 1V1 reference instead?
thank you