albeiro jojoa / Mbed 2 deprecated martes1303

Dependencies:   mbed

Fork of 01-02EjercicioComunicacionSerial by ferney alberto beltran molina

Revision:
0:abaa541e10d5
Child:
1:3989eb5bad79
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 07 01:00:46 2018 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+
+#include "draw.h"
+#define CM_EJECUTAR 0xff
+#define CM_GUARDAR 0xfe
+#define CM_VERTEX2D 0xfd
+#define CM_DRAW 0xfc
+#define CM_NODRAW 0xfb
+#define CM_STOP 0xfa
+#define CM_END 0xf0
+
+
+
+
+Serial command(USBTX, USBRX);
+
+
+void ejecutar(){
+    command.printf("se esta ejecutando el dibujo...");    
+    // ubicar acà el codigo
+}
+void guardar(){
+    command.printf("se inicia el comado de guardar..");    
+    // ubicar acà el codigo
+    
+}
+void init_serial()
+{
+    command.baud(9600);    
+}
+int main() {
+    init_servo();
+    init_serial();
+    home();
+    char read_cc;
+    while(1)
+    {
+        switch (read_cc) {
+            case  CM_EJECUTAR: ejecutar(); break;
+            case  CM_GUARDAR: guardar(); break;
+            default: command.printf("error de comando");break ;      
+        }
+    }
+}