Darrel made an include that does temp conversion, and it goes into negative temperatures.
http://www.pbpgroup.com/modules/wfse...p?articleid=18
Give this a try.
Darrel made an include that does temp conversion, and it goes into negative temperatures.
http://www.pbpgroup.com/modules/wfse...p?articleid=18
Give this a try.
Sayzer,
>> For DS18B20, negative temp value is no problem with Bruce's code.
I'm confused. Does that mean Bruce's code fixed your problem? Or, do you still need help?
And, you're asking about the DS18B20, but the table is for a DS1820
![]()
<br>
DT
Sorry for confusion.
I have already fixed my problem with DS18B20. I have no problem. I get nice negative value reading, too. Everything is perfect.
But,
For DS1820, how do we read negative values? When the temp gets below zero, how do we read it? I could not find a PBP sample code for negative part. I have about 50pcs DS1820 left in hand and have a chance of getting rid of them if I can read negative values.
The table is for DS1820.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Give this a try...<br>Code:Sign VAR BIT TempC VAR WORD ; read DS1820 here Sign = TempC.15 TempC = ABS(TempC) TempC =(TempC>>1)*10 + (TempC.0 * 5) IF Sign then LCDOUT "-" LCDOUT dec (TempC/10),".",dec TempC//10
DT
It is finally working now for the negative values.
I did not have this TempC = ABS(TempC) before TempC =(TempC>>1)*10 + (TempC.0 * 5)
But, now I get correct values.
Thanks a lot Darrel.
Regards.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Very nice of you "trying" to say that Darrel.
I see what you wanted to say, thank you.
But the meaning is a typical "lost in translation".
"Don't mention it" in Turkish = "You are welcome" in English
"You are welcome" in English = "Well Arrived" or "Welcome to a 'place'..."
Here are some funny ones:
Italian:
"Ladies, leave your clothes here and spend the afternoon having a good time."
Japanese:
"Special cocktails for the ladies with nuts"
Swedish:
"Fur coats made for ladies from their own skin"
"Our wines leave you nothing to hope for"
French:
Colgate introduced a toothpaste in France called Cue, the name of a notorious porno mag.
French:
"Please avoid coca watering, cream cleaning, wet towels wrapping, and ironing drying."
And a funny one in German:
"It is strictly forbidden on our black forest camping site that people of different sex, for instance, men and women, live together in one tent unless they are married with each other for that purpose."
Have more here:
http://www.ojohaven.com/fun/translation.funnies.html
---------------------------------
Last edited by sayzer; - 16th October 2006 at 05:16.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks