SOFT253 Coursework Weather Reader

Dependencies:   LPS25H hts221

Fork of Soft253-WeatherReader by Joseph Dumpleton

Files at this revision

API Documentation at this revision

Comitter:
Jdumpleton3
Date:
Tue May 02 11:09:41 2017 +0000
Parent:
5:ba160e9778d0
Commit message:
Finish making the time and fix the ctime padding nonsense

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ba160e9778d0 -r 0cc980145515 main.cpp
--- a/main.cpp	Tue May 02 09:36:46 2017 +0000
+++ b/main.cpp	Tue May 02 11:09:41 2017 +0000
@@ -105,7 +105,10 @@
 }
 /* Prints the data that was read */
 void printData(){
-    printf("%s", ctime(&tempEntry.dt));
+    //Location where string is copied when using strftime
+    char buff[20];
+    strftime(buff, 20, "%Y-%m-%d %H:%M:%S", localtime(&tempEntry.dt));
+    printf("%s \t", buff);  
     printf("%i: %4.2fC %3.1f%%", headNode, tempEntry.airTemp, tempEntry.airPress);
     printf(" %6.1f %4.1f\r\n", tempEntry.barPress, tempEntry.barTemp);
     isNewData = false;