serial communication test

Dependencies:   mbed

main.cpp

Committer:
mzpf46
Date:
2017-10-30
Revision:
0:015c0b1cb2d4

File content as of revision 0:015c0b1cb2d4:

#include "mbed.h"
#include "stdio.h"
#include "math.h"
/* Define some useful constants */
#define HIGH 1
#define LOW 0
DigitalOut myled1(LED1); /* LED1 */
Serial pc(USBTX, USBRX);


int main() {
    char user_cmd;
    pc.scanf("%c",user_cmd);
    
    int right='1';
    
    
    if(user_cmd==right)
    {
         myled1=HIGH;
    }
}