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: mbed
Revision 0:fe2bb272ead2, committed 2019-02-19
- Comitter:
- halusis
- Date:
- Tue Feb 19 02:13:19 2019 +0000
- Commit message:
- txt file io test
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Feb 19 02:13:19 2019 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+
+LocalFileSystem local("local"); // Create the local filesystem under the name "local"
+
+Serial pc(USBTX, USBRX); // tx, rx
+
+float pi;
+double mpi;
+unsigned int n;
+int mn;
+
+int main() {
+ FILE *fp = fopen("/local/mag.txt", "r"); // Open "out.txt" on the local file system for writing
+ //fscanf(fp, "Hello World!");
+ fscanf(fp,"%f %d %lf %d",&pi ,&n ,&mpi ,&mn);
+ fclose(fp);
+
+ pc.printf("pi: %f n: %d mpi: %lf mn: %d",pi ,n ,mpi ,mn);
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Feb 19 02:13:19 2019 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7130f322cb7e \ No newline at end of file