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 SDFileSystem
main.cpp
00001 #include "mbed.h" 00002 #include "inletclose.h" 00003 #include "SDFileSystem.h" 00004 00005 Inlet inlet(p26,p15,p16); 00006 00007 Serial pc(USBTX,USBRX); 00008 00009 SDFileSystem sd(p11, p12, p13, p14, "sd"); 00010 FILE* fp; 00011 00012 DigitalOut myled(LED1); 00013 DigitalOut myled2(LED2); 00014 00015 int main() 00016 { 00017 fp = fopen("/sd/Safety_Test/kanatu.csv", "a"); 00018 if(fp != NULL) 00019 { 00020 myled=1; 00021 } 00022 else 00023 { 00024 myled2=1; 00025 fp = fopen("/sd/Safety_Test/kanatu.csv", "a"); 00026 wait(3); 00027 myled2=0; 00028 } 00029 00030 00031 float time=0; 00032 00033 while(1) 00034 { 00035 inlet.Close(1.1); 00036 pc.printf("%04.2f,%04.2f\n",inlet.getvalue1(),inlet.getvalue2()); 00037 fprintf(fp,"%.2f,%04.2f,%04.2f\n",time,inlet.getvalue1(),inlet.getvalue2()); 00038 wait(0.1); 00039 time=time+0.1; 00040 } 00041 }
Generated on Sun Jul 24 2022 22:05:25 by
1.7.2