Hello everyone
I have the DS18B20 sensor and I made a little temperature logging doohickey; that uses an RTC and the temp sensor to log the temperature every minute. I had an option to display the temperature in Fahrenheit. My code goes like this:
As you can see, I use readtemp to get a integer value to convert to Fahrenheit; then get a real Celsius value with the readtemp12 command. I wondered if it were possible to instead use the value read by readtemp12 and convert that to Fahrenheit.
I have the DS18B20 sensor and I made a little temperature logging doohickey; that uses an RTC and the temp sensor to log the temperature every minute. I had an option to display the temperature in Fahrenheit. My code goes like this:
Code:
readtemp 2, Celsius
pause 750
Fahrenheit = Celsius * 18 / 10 + 32
Celsius = 0
readtemp12 2,w5
w5=w5*10/16
b10=w5/10 'First digits
b11=w5//10 'Decimal points
pause 750
return