Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 6:a16c0a024fd5
- Parent:
- 5:85cbea9f3eb7
diff -r 85cbea9f3eb7 -r a16c0a024fd5 main.cpp --- a/main.cpp Tue Sep 19 16:59:01 2017 +0000 +++ b/main.cpp Tue Sep 19 17:55:20 2017 +0000 @@ -44,6 +44,7 @@ // Pour le time stamp char buffer[32]; +struct tm * timeinfo; // structure de data typedef struct { @@ -194,19 +195,23 @@ // retrive information from queue to data structure data *dataDisplay = (data*)evt.value.p; - printf("Pin numero = %d\n\r", dataDisplay->pinNumero); + printf("Pin numero = %d \t", dataDisplay->pinNumero); // conversion des secondes en format AA:MM:JJ:HH:MM:SS - strftime(buffer, 32, "%y:%m:%d:%H:%M:%S \n\r", localtime(&dataDisplay->seconds)); - printf("Time as a custom formatted string = %s\n\r", buffer); + timeinfo = localtime(&dataDisplay->seconds); + + //strftime(buffer, 32, "%y:%m:%d:%H:%M:%S \n\r", localtime(&dataDisplay->seconds)); + //printf("Time as a custom formatted string = %s\n\r", buffer); + + printf ("Current local time and date: %d:%.2d:%.2d:%.2d:%.2d:%.2d \t", (1900 + timeinfo->tm_year),(timeinfo->tm_mon + 1), (timeinfo->tm_mday), timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); if(dataDisplay->type == POTENTIOMETRE) { - printf("Moyenne courante = %d\n\r", dataDisplay->info); + printf("Moyenne courante = %d \t\n\r", dataDisplay->info); } if(dataDisplay->type == BOUTON) { - printf("etat = %d\n\r", dataDisplay->info); + printf("etat = %d \t\n\r", dataDisplay->info); } mpool.free(dataDisplay); // free memory pool @@ -232,7 +237,7 @@ } int main() { - set_time(1505568984); // Set RTC time to today + set_time(1505829060); // Set RTC time to today Thread thread1; //Create thread 1, READY state threadNumerique = &thread1;