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.
Revision 0:518fb998d26f, committed 2017-10-04
- Comitter:
- santifs
- Date:
- Wed Oct 04 14:56:31 2017 +0000
- Commit message:
- Read and write in terminal. LED blinks.
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 Wed Oct 04 14:56:31 2017 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" + +Serial pc(SERIAL_TX, SERIAL_RX); +DigitalOut led(LED1); + +int main() +{ + pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n"); + while(1) { + char c = pc.getc(); // Read hyperterminal + pc.printf("%c", c); //Write character in Terminal + if (c == '0') { + led = 0; // OFF + } + if (c == '1') { + led = 1; // ON + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 04 14:56:31 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/235179ab3f27 \ No newline at end of file