University of Plymouth - Stages 1, 2 and 3 / Mbed OS Task690solution-mbed-os-FZ429ZI_

Dependencies:   BMP280 ELEC350-Practicals-FZ429 BME280

Fork of Task690solution-mbed-os-FZ429ZI_ by University of Plymouth - Stages 1, 2 and 3

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Thu Nov 23 10:54:42 2017 +0000
Parent:
2:fad34c30dcc4
Child:
4:17fe5b63cd8a
Commit message:
Adds POST test for the BMP280 sensor board

Changed in this revision

BME280.lib Show annotated file Show diff for this revision Revisions of this file
BMP280.lib Show annotated file Show diff for this revision Revisions of this file
ELEC350-Practicals-FZ429.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BME280.lib	Thu Nov 23 10:54:42 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/MACRUM/code/BME280/#c1f1647004c4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BMP280.lib	Thu Nov 23 10:54:42 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/charly/code/BMP280/#d22ecbef9b90
--- a/ELEC350-Practicals-FZ429.lib	Wed Nov 22 15:18:28 2017 +0000
+++ b/ELEC350-Practicals-FZ429.lib	Thu Nov 23 10:54:42 2017 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/University-of-Plymouth-Stage-2-and-3/code/ELEC350-Practicals-FZ429/#d884f14069c6
+https://os.mbed.com/teams/University-of-Plymouth-Stage-2-and-3/code/ELEC350-Practicals-FZ429/#58ba1a6dbf60
--- a/main.cpp	Wed Nov 22 15:18:28 2017 +0000
+++ b/main.cpp	Thu Nov 23 10:54:42 2017 +0000
@@ -30,7 +30,7 @@
     // Open to WRITE
     // *************
     printf("Write to a file\n");
-    FILE* fp = fopen("/sd/test.txt","w");
+    FILE* fp = fopen("/sd/test.txt","a");
     //Check file handle (stream)
     if (fp == NULL) {
         error("Could not open file for write\n");
@@ -53,11 +53,13 @@
         errorCode(FATAL);
     }   
     
-    //Read in three strings
-    char s1[64], s2[64], s3[64];
-    fscanf(fp, "%s %s %s", s1,s2,s3);
+    //Read back all strings
+    char s1[64];
+    while (fscanf(fp, "%s", s1) == 1) {
+        printf("READ BACK: %s\n", s1);
+    }
     //To read a whole line, use: fgets(s1, sizeof(s1), fp);
-    printf("READ BACK: %s %s %s\n", s1, s2, s3);
+    
     
     //Close File
     fclose(fp);