Hello to all. I have been playing with Stan's 20M (with the DS18B20) and it works great in Celcius. Hardware works perfectly. I have been attempting to get the output in Fahrenheit by adding a single line of code for conversion ----- b0= b0/5*9+32 -(multiply Celcius bt 1.8 and add 32)---- and it does display kind of "close" to the tested temp. I have used it after the first b0 read, then first line in the b1 section and again in the b2 section as well. Readings are not correct in that I get "68" in a 72deg room, "50" on an ice cube, and "86" on a 99deg coil. With my limited capabilities, I still struggle with the code. Even with Stan's Excellent line-by-line explainations, and knowing conversion the formula, Here is the code. Please, someone point me in the reght direction. Thanks, JP
(Stan,it will not let me upload the whole piece--Too many images??--
I just put up the first read section in as that is all I changed--Sorry)
'PICAXE-20M,7 seg LED & DS18B20 demo. Stan.SWAN + PICAXE "Forum" 3 May 2008
'Uses single 7 seg display,sequencing digits so 24°C temp="2" then "4" etc
'---------------------------------------------------------------------------
temp20m:readtemp 7,b0 'DS18B20 temp reading at 20M input 7
if b0>128 then gosub negtemps 'Sub zero temps value correction
b0= b0/5*9+32 - MY ONLY ADDED LINE -
b1= b0/10 'divide orig temp to get tens value
b2= b0//10 'divide orig temp so remainder yields units value
if b1=0 then units 'suppress "0" if temps between ±9°C,so "4" & not "04"
(Stan,it will not let me upload the whole piece--Too many images??--
I just put up the first read section in as that is all I changed--Sorry)
'PICAXE-20M,7 seg LED & DS18B20 demo. Stan.SWAN + PICAXE "Forum" 3 May 2008
'Uses single 7 seg display,sequencing digits so 24°C temp="2" then "4" etc
'---------------------------------------------------------------------------
temp20m:readtemp 7,b0 'DS18B20 temp reading at 20M input 7
if b0>128 then gosub negtemps 'Sub zero temps value correction
b0= b0/5*9+32 - MY ONLY ADDED LINE -
b1= b0/10 'divide orig temp to get tens value
b2= b0//10 'divide orig temp so remainder yields units value
if b1=0 then units 'suppress "0" if temps between ±9°C,so "4" & not "04"