I am using the DS18B20 sensor for measuring water temperatures. My sensor was showing readings between 70 and 200 for a day, and then its showing +200 to -200.
Looking at the data in a chart seems like sine waves with values -200 to +200.
It should be 70 to 200, (all temperaures in Farenheit)
Is it possible that when it goes high, its going negative, or is it possible my sensor is going bad?
Interestingly it keeps showing the high number correctly (i assume) but the low number goes way low , instead of about 70, shows -200.
Thanks for pointing it out.
I was so used to programming in other languages whereby I used = on a daily basis, but thanks for pointing out that = is not same as ==. I need to switch gears when writing code in sketch mode and totally my fault.
The first line "- 32400" was to change to my time zone, but I overlooked the semicolon, my mistake; Yes I totally agree to put each statement on a separate line, thats my preferred writing style anyway and I totally agree. At rare times I like to put in 1 line when its a very small fragment that otherwise goes to separate lines. Thats the best practice for best readability as well.
thanks for the shortcut. I am fairly new to arduino so am not yet resorting to shortcuts but soon I will, once I get used to sketch writing. But thanks so much for pointing it out.
Adafruit tells me that the range is -67°F to +257°F. So if you're getting -200°F, something is wrong. I suggest you write a much simpler program, grab a thermometer and prove that you can read a sensor (approximately) correctly.
exit appears a function, so would read "exit();" (or similar - you'd probably want to supply an error code), and returns control to the operating system.