![](/media/cache/profiles/969a086e0717a9b496dd0e9a50ec8010.jpg.50x50_q85.jpg)
UART connection demo.
Diff: main.cpp
- Revision:
- 0:c00df3e62680
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 25 15:46:25 2012 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" + +Serial device(p9, p10); // tx, rx + +int main() { + device.baud(19200); + device.printf("?"); + + int i; + for (i = 0; i < 20; i++) { + device.printf("<NUMK VAL=%d>kaime no zikko'u de_su\r", i + 1); + for (;;) { + if(device.readable()) { + if (device.getc() == '>') { + break; + } + } + wait(0.5); + } + } + device.printf("owari de_su\r"); +}