OK, this has got me pulling my hair out - if I had any
I've successfully gotten Arduino to talk to 2 x 1-wire temp sensors today. Hurrah. I used the excellent tutorial at playground/Learning/OneWire to achieve this and have hacked it a bit to my purposes. At the end of the code there are a series of Serial.print commands to send the info to the serial port. So far so good. The relevant section is below:
if (SignBit) // If its negative
{
Serial.print("-");
}
Serial.print(Whole);
Serial.print(".");
if (Fract < 10)
{
Serial.print("0");
}
Serial.print(Fract);
Serial.print("\n");
Now to the bit I'm struggling with:
I want to use the value printed to serial as a float value to use in a relay control circuit operated by the Arduino. I did a bit of searching on the forum and can only find reference to strcpy() and strcat() which is apparently no good for signed integers. I want to end up with a "Temp" variable e.g.
int Temp;
Temp = 23.25; // or -23.25 although unlikely
As you may have guessed I'm quite new to this. Any suggestions gratefully received!
Thanks, Mark