Lab3-01_save_the_letters_lite

Dependencies:   mbed HEPTA_CDH_lite

Files at this revision

API Documentation at this revision

Comitter:
heptasat2021
Date:
Wed Aug 11 03:50:32 2021 +0000
Parent:
0:da0f6aca15b8
Commit message:
Lab3-01_save_the_letters_lite

Changed in this revision

HEPTA_CDH_lite.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r da0f6aca15b8 -r ddac5ec89167 HEPTA_CDH_lite.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HEPTA_CDH_lite.lib	Wed Aug 11 03:50:32 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/heptasat2021/code/HEPTA_CDH_lite/#d78a8add1c5e
diff -r da0f6aca15b8 -r ddac5ec89167 main.cpp
--- a/main.cpp	Tue Aug 10 01:51:51 2021 +0000
+++ b/main.cpp	Wed Aug 11 03:50:32 2021 +0000
@@ -1,15 +1,19 @@
 #include "mbed.h"
+#include "HEPTA_CDH.h"
+HEPTA_CDH cdh(PB_5, PB_4, PB_3, PA_8, "sd");
 Serial pc(USBTX,USBRX,9600);
 int main()
 {
-    char a,b;
-    a = 'A';
-    pc.putc(a);
-    for(int i=0;i<10;i++) {
-        pc.printf("\r\n i=%d -- press any key -->",i);
-        b = pc.getc();
-        pc.putc(b);
-        wait_ms(500);
+    pc.printf("Hello World!\n");
+ 
+    mkdir("/sd/mydir", 0777);
+ 
+    FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
+    if(fp == NULL) {
+        error("Could not open file for write\r\n");
     }
-    pc.printf("\r\n End of program\r\n");
+    fprintf(fp, "Hello my name is HEPTA\r\n");
+    fclose(fp);
+ 
+    pc.printf("Goodbye World!\r\n");
 }
\ No newline at end of file
diff -r da0f6aca15b8 -r ddac5ec89167 mbed.bld
--- a/mbed.bld	Tue Aug 10 01:51:51 2021 +0000
+++ b/mbed.bld	Wed Aug 11 03:50:32 2021 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e1686b8d5b90
\ No newline at end of file