Skip to content

Commit b89b320

Browse files
author
Alasdair Allan
authored
Merge pull request #4 from atrueresistance/patch-1
Added comments to the code example. LGTM.
2 parents c873588 + c8a1904 commit b89b320

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)