Skip to content

Commit f3da8fb

Browse files
committed
Switch Analog Voltage on esp32 to use analogReadMilliVolts
1 parent 5990002 commit f3da8fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/analogIO/Wippersnapper_AnalogIO.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,12 @@ uint16_t Wippersnapper_AnalogIO::getPinValue(int pin) {
232232
*/
233233
/**********************************************************/
234234
float Wippersnapper_AnalogIO::getPinValueVolts(int pin) {
235+
#ifdef ARDUINO_ARCH_ESP32
236+
return analogReadMilliVolts(pin) / 1000.0;
237+
#else
235238
uint16_t rawValue = getPinValue(pin);
236239
return rawValue * getAref() / 65536;
240+
#endif
237241
}
238242

239243
/******************************************************************/

0 commit comments

Comments
 (0)