Thank you for the correct information.... and the constant 65335 in "temp = math.log(10000.0 / (65335 / read - 1))" should be 65535 == 0xffff
As you said, I modified it as the code below.
But among what you said, 65535 should be 0xffff, but I didn't understand this part.
Can you tell me what it's about?
<Correction Code>
from machine import ADC, Pin
import math
import utime
adc = ADC(Pin(26))
while True:
read = adc.read_u16()
temp = math.log(10000.0 / (65336 / read - 1))
temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * temp * temp))* temp);
temp = temp - 273.15
print(temp, end = " ℃\n")
utime.sleep(1)
Statistics: Posted by os933 — Sun Oct 27, 2024 7:01 am