This demo program output text to the serial link once a second. It was written as part of the Heriot Watt Robotics Society Hamilton Circle Electronics Workshop
Revision 0:be67304b610a, committed 2017-11-09
- Comitter:
- coloursearch
- Date:
- Thu Nov 09 17:05:43 2017 +0000
- Commit message:
- This program output to terminal once a second
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 be67304b610a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 09 17:05:43 2017 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); + +int counter = 0; + +int main() { + + while(1) { + counter++; + if(counter % 10 == 0){ + pc.printf("%d\n\r", counter); + } + wait(0.1); + } +} \ No newline at end of file
diff -r 000000000000 -r be67304b610a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 09 17:05:43 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600 \ No newline at end of file