File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -87,16 +87,15 @@ void Wippersnapper_AnalogIO::setADCResolution(int resolution) {
87
87
analogReadResolution (16 );
88
88
_nativeResolution = 12 ;
89
89
#elif defined(ARDUINO_ARCH_ESP32)
90
- scaleAnalogRead = true ;
91
- _nativeResolution = 13 ;
90
+ scaleAnalogRead = false ; // handled in bsp
91
+ _nativeResolution = 13 ; // S3 ADC is 13-bit, others are 12-bit
92
92
#elif defined(ARDUINO_ARCH_RP2040)
93
93
scaleAnalogRead = true ;
94
94
_nativeResolution = 10 ;
95
95
#else
96
96
scaleAnalogRead = true ;
97
97
_nativeResolution = 10 ;
98
98
#endif
99
-
100
99
_adcResolution = resolution;
101
100
}
102
101
@@ -233,8 +232,10 @@ uint16_t Wippersnapper_AnalogIO::getPinValue(int pin) {
233
232
/* *********************************************************/
234
233
float Wippersnapper_AnalogIO::getPinValueVolts (int pin) {
235
234
#ifdef ARDUINO_ARCH_ESP32
235
+ WS_DEBUG_PRINTLN (" ESP32: Using analogReadMilliVolts()" );
236
236
return analogReadMilliVolts (pin) / 1000.0 ;
237
237
#else
238
+ WS_DEBUG_PRINTLN (" Using old getPinValueVolts()" );
238
239
uint16_t rawValue = getPinValue (pin);
239
240
return rawValue * getAref () / 65536 ;
240
241
#endif
You can’t perform that action at this time.
0 commit comments