Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 0:c401fd4ffbe7, committed 2015-09-29
- Comitter:
- noutram
- Date:
- Tue Sep 29 11:33:08 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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 29 11:33:08 2015 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" + +Serial pc(SERIAL_TX, SERIAL_RX); + +char nameStr[30]; +int age = 1; + +void getData() +{ + pc.scanf("%s %d", &nameStr, &age); +} + +void printData() +{ + pc.printf("Hello %s \n\r", nameStr); + pc.printf("You are %d \n\r", age); +} + +int main() +{ + int counter = 0; + while (age > 0) + { + getData(); + printData(); + counter++; + } + pc.printf("You entered %d names\n", counter); + sleep(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 29 11:33:08 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa \ No newline at end of file