test

Dependencies:   SDFileSystem USBHost_SAMPLE mbed

Fork of Production_ver1_0 by 幸隆 小森

Files at this revision

API Documentation at this revision

Comitter:
USER10
Date:
Thu Nov 16 00:20:03 2017 +0000
Parent:
2:c34453addfec
Commit message:
Host Program;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c34453addfec -r df84dd8c122c main.cpp
--- a/main.cpp	Tue Nov 07 00:25:56 2017 +0000
+++ b/main.cpp	Thu Nov 16 00:20:03 2017 +0000
@@ -6,13 +6,15 @@
 SDFileSystem sd(p5, p6, p7, p8, "sd");
 int i=0;
 
+Serial pc2(p13, p14);//tx1, rx1
+
 void onKey(uint8_t key) {
-    printf("Key: 0x%x : %c\r\n", key, key);
+    pc2.printf("%c", key);
 
     ++i;
     FILE *fp;
-    fp = fopen("/sd/keylog/keylog.csv", "a");
-    fprintf(fp, "Keydata[%d], :,0x%x,:,%c\r\n", i, key, key);
+    fp = fopen("/sd/keylog/log.csv", "a");
+    fprintf(fp, "Key[%d], :,0x%x,:,%c\r\n", i, key, key);
     fclose(fp); 
 
 }
@@ -38,7 +40,7 @@
 int main() {
     mkdir("/sd/keylog", 0777);
     FILE *fp;
-    fp = fopen("/sd/keylog/keylog.csv","w");
+    fp = fopen("/sd/keylog/log.csv","w");
     fclose(fp);
     
     Thread keyboardTask(keyboard_task, NULL, osPriorityNormal, 256 * 4);