serial transfer from desktop

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
ashea6
Date:
Tue Nov 15 21:42:29 2016 +0000
Commit message:
serial

Changed in this revision

4DGL-uLCD-SE.lib Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.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 000000000000 -r 89af7d89f2d5 4DGL-uLCD-SE.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/4DGL-uLCD-SE.lib	Tue Nov 15 21:42:29 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/sparkfun/code/4DGL-uLCD-SE/#e39a44de229a
diff -r 000000000000 -r 89af7d89f2d5 SDFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Tue Nov 15 21:42:29 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/SDFileSystem/#8db0d3b02cec
diff -r 000000000000 -r 89af7d89f2d5 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Nov 15 21:42:29 2016 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+#include "uLCD_4DGL.h"
+
+DigitalOut myled(LED1);
+uLCD_4DGL uLCD(p28,p27,p29);
+SDFileSystem sd(p5, p6, p7, p8, "sd");
+Serial blue(USBTX, USBRX);
+//Serial blue(p13, p14);          // TX, RX
+
+
+int main() {
+    blue.baud(9600);
+    while(1) {
+        //if (blue.readable()) 
+        //{
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+        char buff[1000];
+        for (int j = 0; j < 20; j++) {
+            buff[j] = 'z';
+        }
+        int i = 0;
+        bool flag = false;
+        while(!flag) {
+            buff[i] = blue.getc();
+            uLCD.printf("%c", buff[i]);
+            //blue.putc(buff[i]);
+            flag = buff[i] == '^';
+            if (flag) uLCD.printf("flag detected");
+            i++;
+        }
+        //uLCD.printf("%s", buff);
+
+        mkdir("/sd/mydir", 0777);
+        FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
+        if(fp == NULL) {
+            error("Could not open file for write\n");
+        }
+        fprintf(fp, buff);
+        fclose(fp);
+        //}
+    }
+}
diff -r 000000000000 -r 89af7d89f2d5 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Nov 15 21:42:29 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0
\ No newline at end of file