Skip to content

Commit 0e6ca28

Browse files
Update wiring_analog.cpp (#1092)
1 parent d718b14 commit 0e6ca28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/rp2040/wiring_analog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ extern "C" float analogReadTemp(float vref) {
172172
adc_select_input(4); // Temperature sensor
173173
int v = adc_read();
174174
adc_set_temp_sensor_enabled(false);
175-
float t = 27.0f - ((v * vref / pow(2, _readBits)) - 0.706f) / 0.001721f; // From the datasheet
175+
float t = 27.0f - ((v * vref / 4096.0f) - 0.706f) / 0.001721f; // From the datasheet
176176
return t;
177177
}
178178

0 commit comments

Comments
 (0)