Rosie Lewis
/
mbed_blinky
serial communication test
Revision 0:015c0b1cb2d4, committed 2017-10-30
- Comitter:
- mzpf46
- Date:
- Mon Oct 30 14:20:09 2017 +0000
- Commit message:
- serial communication test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 30 14:20:09 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/97feb9bacc10 \ No newline at end of file