Im trying to inject the current date into the serial output that my barograph is sending.
It outputs pascals, but I would like to build a filter to only log infrasound events of interest.
To make sense of the data I need to include an accurate time-stamp.
Using Time.h I have been able to inject milis() into the file but that does not solve the problem.
If I could get now() to work in my code that would be OK as once I got the data out of the morrass of Arduino I could mash it around to reveal a proper iso date time (yyyymmdd_hhmmss.ssssssss) or a Julian date (astronomical).
I am able to get year() to work (sort of) but it outputs 1970. So I must be missing a command to poll the PC and get the PC time and dump that into a varriable. That or GPS time would be fine.
time_t t=now()+1446316592;//amazingly this works but it is only a cosmetic fudge
Serial.print (t);
Serial.print(",");
//Serial.print(year());//this 'works' but outputs 1970 indicating that the time/date functions are not reading system time / date.
Serial.print(" ");
Serial.print (micros());//this is a great little way to do interval timing but its not what I need
// read the pressure. Parameter is 0, 1, 2, or 3 for oversampling, see Bosch BMP180 datasheet.
status = bmp180.startPressure(3);
if (status != 0) {
delay(status);
status = bmp180.getPressure(pressure,temp);
if (status != 0) {
// We will submit intergers rather than floats because
// sprintf doesn't support floats without using tricks.
// It is easy to divide by 10000 on the receivers side
// to get back floats.
pressure = 10000 * pressure;
sprintf(buf, ",%lu \n", (unsigned long)pressure);
Serial.write(buf);
REBOOT
BMP180 init success v1
t18455;1446316592, 13428,9108736
1446316592, 41748,9108224
1446316592, 70084,9108151
1446316592, 98420,9108443
1446316592, 126748,9108224
1446316592, 155120,9107053
1446316592, 183492,9106907
1446316592, 211868,9107382
1446316592, 240256,9106979
1446316592, 268632,9107162
1446316592, 297016,9107016
1446316592, 325388,9106650