We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d718b14 commit 0e6ca28Copy full SHA for 0e6ca28
cores/rp2040/wiring_analog.cpp
@@ -172,7 +172,7 @@ extern "C" float analogReadTemp(float vref) {
172
adc_select_input(4); // Temperature sensor
173
int v = adc_read();
174
adc_set_temp_sensor_enabled(false);
175
- float t = 27.0f - ((v * vref / pow(2, _readBits)) - 0.706f) / 0.001721f; // From the datasheet
+ float t = 27.0f - ((v * vref / 4096.0f) - 0.706f) / 0.001721f; // From the datasheet
176
return t;
177
}
178
0 commit comments