We're working on a project and we can't found the problem. We want measure the temperatur with a temperature sensor. Could you control the code please??
WINUS:
We're working on a project and we can't found the problem. We want measure the temperatur with a temperature sensor. Could you control the code please??
You need to define what analog pin the temp sensor is connected to and make it INPUT. Then you need to read from that pin NOT analogRead(9600). The analog pin will definitely not be 9600.
Most Arduinos will not do math with anywhere near 14 digits of precision so your calculations may also be a problem.
Also it should be Serial.println - the character before the n is a small L not a capital I.
So... this temperature sensor, is a thermistor? That's what the code suggest, you didn't specify.
For regular Arduinos a double is an alias of float. You don't get more than 6-7 digits of precision.
Your formulas don't resemble any that I know for thermistors. See e.g. this Adafruit tutorial on how to deal with these things.
slipstick:
Most Arduinos will not do math with anywhere near 14 digits of precision so your calculations may also be a problem.
No problem here. A number like 0.0000000876741 has just 6 relevant digits. A float stores it as 8.76741E-8. A number such as 0.001129148 (1.129148E-3) is more of an issue, the last digit may get lost.