Xbee receiver Module

Dependencies:   TextLCD mbed

main.cpp

Committer:
anoop1728
Date:
2011-02-28
Revision:
0:3d9570678c6d

File content as of revision 0:3d9570678c6d:

 #include "mbed.h"
 #include "TextLCD.h"
  
 Serial xbee1(p9, p10);
 DigitalOut rst1(p8);
 
 DigitalOut myled(LED1);
 TextLCD lcd(p15, p16, p17, p18, p19, p20);
 
 int main() {

     rst1 = 0;   //Set reset pin to 0
     myled = 0;
     wait_ms(1);
     rst1 = 1;   //Set reset pin to 1
     wait_ms(1);
     int X; 

     while (1) {
        if(xbee1.readable()){
             wait(1);
              myled = 1;
             
            xbee1.scanf("%d", &X);
           // X = xbee1.getc();
             wait(1);
             myled = 0;                
             lcd.printf("data received %f \n\r ", (X)/10.0);
             
           }
         }
     }