Rosie Lewis
/
mbed_blinky
serial communication test
Diff: main.cpp
- Revision:
- 0:015c0b1cb2d4
diff -r 000000000000 -r 015c0b1cb2d4 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 30 14:20:09 2017 +0000 @@ -0,0 +1,22 @@ +#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; + } +} \ No newline at end of file