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.
Fork of LocalFileSystem_HelloWorld by
main.cpp
00001 #include "mbed.h" 00002 Serial pc(USBTX, USBRX); // tx, rx 00003 LocalFileSystem local("local"); // Create the local filesystem under the name "local" 00004 DigitalOut myled1(LED1); 00005 DigitalOut myled2(LED2); 00006 00007 int main() { 00008 int tablo[6] = {0}; 00009 int i = 0; 00010 myled1 = 1 ; 00011 myled1 = 0 ; 00012 printf("Debut programme \n"); 00013 printf("Lecture des donnees \n"); 00014 FILE *fp = fopen("/local/compil.txt", "r"); // Open "out.txt" on the local file system for writing 00015 for (i =0; i<6; i++) 00016 { 00017 fscanf(fp, "%d \n", &tablo[i]); 00018 } 00019 fclose(fp); 00020 // sortie sur moniteur 00021 printf("Donnees lues \n"); 00022 myled1 = 0 ; 00023 for (i =0; i<6; i++) 00024 { 00025 printf("tablo[%d] = %d \n", i, tablo[i]); 00026 } 00027 printf("Fin programme \n"); 00028 myled2 = 1 ; 00029 00030 }
Generated on Thu Jul 14 2022 08:42:59 by
1.7.2
