XBee to LCD

Dependencies:   TextLCD mbed

Fork of XBEE_LCD by toshio masuda

Committer:
MasudaToshio
Date:
Thu May 23 11:06:47 2013 +0000
Revision:
1:7345f104ff5c
Parent:
0:48b9e99fafc8
XBee LCD

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MasudaToshio 0:48b9e99fafc8 1 #include "mbed.h"
MasudaToshio 0:48b9e99fafc8 2 #include "TextLCD.h"
MasudaToshio 0:48b9e99fafc8 3
MasudaToshio 1:7345f104ff5c 4 Serial xbee(p13, p14); // tx, rx
MasudaToshio 0:48b9e99fafc8 5 TextLCD lcd(p24, p26, p27, p28, p29, p30);
MasudaToshio 0:48b9e99fafc8 6
MasudaToshio 0:48b9e99fafc8 7 /////////////////////////////////////////////////////
MasudaToshio 0:48b9e99fafc8 8 // main
MasudaToshio 0:48b9e99fafc8 9 /////////////////////////////////////////////////////
MasudaToshio 0:48b9e99fafc8 10 int main(void) {
MasudaToshio 1:7345f104ff5c 11 char pc_in[32] ;
MasudaToshio 1:7345f104ff5c 12 lcd.cls() ;
MasudaToshio 1:7345f104ff5c 13 lcd.printf( "wait xbee input" ) ;
MasudaToshio 0:48b9e99fafc8 14
MasudaToshio 0:48b9e99fafc8 15 while(1) {
MasudaToshio 1:7345f104ff5c 16 if(xbee.readable()) {
MasudaToshio 1:7345f104ff5c 17 pc_in[0] = xbee.getc() ;
MasudaToshio 1:7345f104ff5c 18 if( pc_in[0] == 0x063 ){
MasudaToshio 1:7345f104ff5c 19 lcd.cls();
MasudaToshio 1:7345f104ff5c 20 }else{
MasudaToshio 1:7345f104ff5c 21 lcd.printf( pc_in );
MasudaToshio 1:7345f104ff5c 22 }
MasudaToshio 1:7345f104ff5c 23 }
MasudaToshio 0:48b9e99fafc8 24 }
MasudaToshio 0:48b9e99fafc8 25 return 0;
MasudaToshio 1:7345f104ff5c 26 }