futz
Active Member
I'm probably doing it wrong, but I'm using this piece of code (straight from Page 81 of the BoostC manual) to read my 18B20:
The numbers in celsius change as the sensor changes temperature, but they don't jive with what's in the 18B20 datasheet at all. I'm getting results like celsius=$bfaf. Makes no sense to me (so far). If I take the two middle nybbles as my temperature I get -122C? What?
Code:
oo_busreset();
oo_start_conversion();
if(oo_wait_for_completion()){
error=0xff;
}
if(oo_read_scratchpad()){
error=0xff;
}
celsius=oo_get_data();