Basic Xbee reciever with application board. Uses LCD to display up or down.

Dependencies:   C12832 mbed

Revision:
0:ee395ccc1347
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Feb 20 11:56:30 2016 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "C12832.h"
+
+Serial xbee(p9,p10);                //Create serial object
+char a;
+C12832 lcd(p5, p7, p6, p8, p11);    //Used for the LCD
+DigitalOut nReset(p30);             //reset pin of the xbee
+
+
+int main()
+{
+    xbee.baud(57600);               //set the baud rate of the xbee. (9600 standard)
+    while(1) {
+        lcd.locate(0,3);
+        wait_ms(500);
+        
+        if(xbee.readable()) {       //Checks if the data is readable
+            a = xbee.getc();        //Get the first character that's in the buffer
+        }
+        if(a=='u') {                //detects if joystick is pressed up
+
+            lcd.cls();              //NOT SURE: wipes LCD screen.           
+            lcd.printf("up");
+
+        }
+        if(a=='d') {                //detects if yoystick is pressed down
+
+            lcd.cls();
+            lcd.printf("down");
+
+        }
+
+
+    }
+}