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.
Fork of 01-02EjercicioComunicacionSerial by
Diff: main.cpp
- Revision:
- 0:abaa541e10d5
- Child:
- 1:3989eb5bad79
diff -r 000000000000 -r abaa541e10d5 main.cpp
--- /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 ;
+ }
+ }
+}
