Emiel Estiévenart
/
ProjectReciever01
Basic Xbee reciever with application board. Uses LCD to display up or down.
main.cpp
- Committer:
- Perijah
- Date:
- 2016-02-20
- Revision:
- 0:ee395ccc1347
File content as of revision 0:ee395ccc1347:
#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"); } } }