albeiro jojoa / Mbed 2 deprecated martes1303

Dependencies:   mbed

Fork of 01-02EjercicioComunicacionSerial by ferney alberto beltran molina

main.cpp

Committer:
fabeltranm
Date:
2018-03-07
Revision:
0:abaa541e10d5
Child:
1:3989eb5bad79

File content as of revision 0:abaa541e10d5:

#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 ;      
        }
    }
}