Alex Louden
/
XBee_read
Revision 0:2eaf86314aea, committed 2010-06-04
- Comitter:
- alex89
- Date:
- Fri Jun 04 10:23:38 2010 +0000
- Commit message:
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 |
diff -r 000000000000 -r 2eaf86314aea main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 04 10:23:38 2010 +0000 @@ -0,0 +1,43 @@ +#include "mbed.h" +#include "TextLCD.h" + +Serial xbee1(p9, p10); +DigitalOut rst1(p11); + +DigitalOut myled(LED1); +DigitalOut myled2(LED2); + +TextLCD lcd(p16, p15, p14, p17, p18, p19, p20); // rs, rw, e, d0, d1, d2, d3 + +int main() { + rst1 = 0; //Set reset pin to 0 + myled = 0; + myled2= 0; + wait_ms(1); + rst1 = 1; //Set reset pin to 1 + wait_ms(1); + + lcd.printf("starting"); + wait(2); + lcd.cls(); + + int a = 0; + int prev = 0; + + while (1) { + + if(xbee1.readable()){ + prev = a; + a = xbee1.getc(); //XBee read + + if (a != prev){ + if (a < 10){ + lcd.printf("%d", a); + } + if (a == 254 || a == 253){ + lcd.cls(); + } + } + } + } +}
diff -r 000000000000 -r 2eaf86314aea mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jun 04 10:23:38 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/029aa53d7323