Skip to content

Commit c8a1904

Browse files
Update temperature.py
Add some comments from the RP2040 datasheet that helps new users understand where the constant number values came from.
1 parent f62ca72 commit c8a1904

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adc/temperature.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
while True:
88
reading = sensor_temp.read_u16() * conversion_factor
99

10+
# The temperature sensor measures the Vbe voltage of a biased bipolar diode, connected to the fifth ADC channel
11+
# Typically, Vbe = 0.706V at 27 degrees C, with a slope of -1.721mV (0.001721) per degree.
1012
temperature = 27 - (reading - 0.706)/0.001721
1113
print(temperature)
1214
utime.sleep(2)

0 commit comments

Comments
 (0)