#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <time.h>
#include <math.h>
#define BAUDRATE B9600
break;
}
- fprintf(stderr, "Getting temperature done %16s %f\n", buf, temperature);
-
return temperature;
}
Init();
while (1) {
- double foo = ReadTEMP();
-
-/* printf("%f\n", foo);*/
- usleep(50000);
+ double temperature = ReadTEMP();
+ time_t now = time(NULL);
+ printf("%s %f\n", ctime(&now), temperature);
+ sleep(1);
}
return 0;
}