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 #include "mbed.h" 00002 #include "HEPTA_CDH.h" 00003 00004 RawSerial pc(USBTX,USBRX,9600); 00005 HEPTA_CDH cdh(p5, p6, p7, p8, "sd"); 00006 00007 int main() 00008 { 00009 pc.printf("Hello world!\r\n"); 00010 char str[100]; 00011 mkdir("/sd/mydir", 0777); 00012 FILE *fp = fopen("/sd/mydir/test.txt","w"); 00013 if(fp == NULL) { 00014 error("Could not open file for write\r\n"); 00015 } 00016 for(int i=0; i<10; i++)fprintf(fp,"Hello my name is HEPTA!\r\n"); 00017 fclose(fp); 00018 fp = fopen("/sd/mydir/test.txt","r"); 00019 for(int j = 0; j < 10; j++) { 00020 fgets(str,100,fp); 00021 pc.puts(str); 00022 } 00023 fclose(fp); 00024 pc.printf("Goodbye!!\r\n"); 00025 }
Generated on Mon Nov 7 2022 14:38:15 by
1.7.2