Arduino and 1-wire

venalicio: (Sorry for not responding sooner, but your edit didn't trigger a notification.) The code to read the temperature needs to be slightly different for the DS18B20 (and DS1822), because it returns a 12-bit temperature value (0.0625 deg precision), while the DS18S20 and DS1820 return 9-bit values (0.5 deg precision). Assuming you've gotten the msb and lsb for the temperature, here's how converting to a floating-point temperature value is pretty easy. You should just need the following code:

DS18S20:

int hext = (msb << 8) + lsb;
double tempc = (double)hext * 0.5;

DS18B20

int hext = (msb << 8) + lsb;
double tempc = (double)hext * 0.0625;

These snippets ought to work, but I don't have my Arduino wired up to the temperature sensors at the moment, and so I can't verify it right now.