Tedd OKANO
/
__Serial2_sample
code sample for workshop
Revision 0:228cf6908a24, committed 2015-04-13
- Comitter:
- okano
- Date:
- Mon Apr 13 07:38:02 2015 +0000
- Commit message:
- initial version
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 |
diff -r 000000000000 -r 228cf6908a24 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Apr 13 07:38:02 2015 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" + +DigitalOut myled( LED1 ); +DigitalIn input( p5 ); +Serial ser( USBTX, USBRX ); + +int main() { + input.mode( PullUp ); + + while(1) { + myled = !input; + ser.printf( "switch is %s\r\n", input ? "OFF" : "ON" ); + wait( 0.5 ); + } +}
diff -r 000000000000 -r 228cf6908a24 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Apr 13 07:38:02 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0 \ No newline at end of file