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.
Dependencies: BMP280 ELEC350-Practicals-FZ429 BME280
Fork of Task690-mbed-os-FZ429ZI by
Revision 3:22e5460a8b42, committed 2017-11-23
- Comitter:
- noutram
- Date:
- Thu Nov 23 10:54:42 2017 +0000
- Parent:
- 2:fad34c30dcc4
- Child:
- 4:04cd5171c7ff
- Commit message:
- Adds POST test for the BMP280 sensor board
Changed in this revision
--- /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);
