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.
main.cpp
00001 /* Program Example 10.1: read and write char data bytes 00002 */ 00003 #include "mbed.h" 00004 Serial pc(USBTX,USBRX); // setup terminal link 00005 LocalFileSystem local("local"); // define local file system 00006 int write_var; 00007 int read_var; // create data variables 00008 00009 int main () 00010 { 00011 FILE* File1 = fopen("/local/datafile.txt","w"); // open file 00012 write_var=0x23; // example data 00013 fputc(write_var, File1); // put char (data value) into file 00014 fclose(File1); // close file 00015 00016 FILE* File2 = fopen ("/local/datafile.txt","r"); // open file for reading 00017 read_var = fgetc(File2); // read first data value 00018 fclose(File2); // close file 00019 pc.printf("input value = %i \n",read_var); // display read data value 00020 } 00021
Generated on Thu Jul 21 2022 01:15:02 by
1.7.2