Delay(100);
SDin();
HiLowSCLK();
-
+
SDout(0);
HiLowSCLK();
SDout(0);
HiLowSCLK();
Stop_IIC();
-
char str_msb[4];
char str_lsb[9];
char FuHao = buf[0];
fprintf(stderr, "Getting temperature done %16s %f\n", buf, temperature);
return temperature;
-
-/* String str_data = data.ToString();
- String FuHao = Strings.Left(str_data, 1);
- String str_temp = Strings.Left(str_data, 11);
- String str_msb = Strings.Left(str_temp, 3);
- String str_lsb = Strings.Right(str_temp, 8);
- double msb = Bin2Dec(str_msb);
- double lsb = Bin2Dec(str_lsb);
- double tempdata = (msb * 256.0) + lsb;
- switch (FuHao)
- {
- case "0":
- ReadTEMP = tempdata * 0.125;
- break;
-
- case "1":
- ReadTEMP = -(2048.0 - tempdata) * 0.125;
- break;
- }
-
-
- return ReadTEMP;
-*/
}
int main(int argc, char **argv)
tcgetattr(fd,&oldtio); /* save current port settings */
memcpy(&newtio, &oldtio, sizeof(newtio));
-/* bzero(&newtio, sizeof(newtio));*/
- newtio.c_cflag |= (CLOCAL | CREAD);
+ newtio.c_cflag |= (CLOCAL | CREAD);
newtio.c_cflag &= ~PARENB;
newtio.c_cflag &= ~CSTOPB;
newtio.c_cflag &= ~CSIZE;