io
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:fe2bb272ead2
diff -r 000000000000 -r fe2bb272ead2 main.cpp --- /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