SLIP UART demo
Revision 0:313c84319d93, committed 2015-11-05
- Comitter:
- janekm
- Date:
- Thu Nov 05 08:10:48 2015 +0000
- Child:
- 1:2d5fabdb498a
- Commit message:
- Example of configuring the Serial port
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed-src.lib | 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 Thu Nov 05 08:10:48 2015 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" + +//------------------------------------ +// Hyperterminal configuration +// 9600 bauds, 8-bit data, no parity +//------------------------------------ + +Serial pc(p8, p10); + +DigitalOut myled(p24); +DigitalOut S900Vcc(p9); +DigitalOut S900En(p20); +DigitalOut S900On(p13); + +int main() { + int i = 1; + pc.baud(19200); + pc.printf("Hello World !\n"); + while(1) { + wait(1); + pc.printf("This program runs since %d seconds.\n", i++); + myled = !myled; + } +} + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-src.lib Thu Nov 05 08:10:48 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-src/#6fe765be4226