Hello
I am trying to get the real-time clock to work with the LPC1768, according to the examples at
http://mbed.org/blog/entry/103/
time(NULL) returns -1 in all cases. Is this an issue with the mbed, or something I am doing wrong? Relatedly, how does the mbed actually get these times (when it is working)?
For convenience, the code I ran is
#include "mbed.h"
int main() {
while(1) {
time_t seconds = time(NULL);
printf("Seconds since January 1, 1970: %d\r\n", seconds);
wait(1);
}
}
with output
Seconds since January 1, 1970: -1
Seconds since January 1, 1970: -1
Seconds since January 1, 1970: -1
...
As background, I am trying send data taken over a long period time from sensors with Unix timestamps. I feel that the cleanest way to do this would be for the mbed to generate these timestamps instead of the host.
Thank you
-Frank
Hello
I am trying to get the real-time clock to work with the LPC1768, according to the examples at
http://mbed.org/blog/entry/103/
time(NULL) returns -1 in all cases. Is this an issue with the mbed, or something I am doing wrong? Relatedly, how does the mbed actually get these times (when it is working)?
For convenience, the code I ran is
with output
As background, I am trying send data taken over a long period time from sensors with Unix timestamps. I feel that the cleanest way to do this would be for the mbed to generate these timestamps instead of the host.
Thank you
-Frank