Olli Vanhoja
/
xBee
xBee
Diff: main.cpp
- Revision:
- 0:265bb7b57633
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 01 13:41:37 2011 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" + +Serial xbee1(p9, p10); +Serial pc(USBTX, USBRX); + +uint32_t i=0; + +void readxBee() +{ + char c; + + i++; + //if(xbee1.readable()) + //{ + xbee1.scanf("%c", &c); + pc.printf("%c", c); + //} + if(c == '?') + { + xbee1.printf("i=%u\n\r", i); + } +} +int main() { + xbee1.attach(&readxBee, Serial::RxIrq); +}