FORARKADI

Dependencies:   mbed mypidror1 Motor Map

Revision:
7:34118a0098e8
Parent:
6:13f47e31348d
Child:
8:4b5f04325cbe
--- a/recive.cpp	Fri Mar 13 12:23:35 2020 +0000
+++ b/recive.cpp	Fri Mar 13 12:35:04 2020 +0000
@@ -51,6 +51,10 @@
 
 CAN can1(PA_11, PA_12);
 
+//Xbee
+
+BufferedSerial xbee(PA_9, PA_10);
+
 //Motor Control
 
 Motor myMotor(PA_8, PA_5, PA_6);
@@ -247,10 +251,12 @@
             }*/
 }
 int main() {
-    pc.baud(9600);
+    pc.baud(57600);
+    xbee.baud(57600);
     pid.start();
     main_ticker.attach(readSensors, 0.0005);
     while(1){
-        pc.printf("Pedal: %.4f\n\n\r, Thorttle: %.4f\n\n\r, subthorttle: %.4f\n\n\r, recievecounter: %d\n\n\r, ThorttleErrorFlag: %d\n\n\r, PedalErrorFlag: %d\n\n\r, CanTimeoutFlag: %d\n\n\r", pdagree, mdagree, subThorttle, recievecounter, terrorflag, perrorflag, cantimeoutflag);
+        //pc.printf("Pedal: %.4f\n\n\r, Thorttle: %.4f\n\n\r, subthorttle: %.4f\n\n\r, recievecounter: %d\n\n\r, ThorttleErrorFlag: %d\n\n\r, PedalErrorFlag: %d\n\n\r, CanTimeoutFlag: %d\n\n\r", pdagree, mdagree, subThorttle, recievecounter, terrorflag, perrorflag, cantimeoutflag);
+        xbee.printf("Pedal: %.4f\n\n\r, Thorttle:\n\r, recievecounter: %d\n\n\r, ThorttleErrorFlag: %d\n\n\r,, pdagree, mdagree, subThorttle, recievecounter, terrorflag, perrorflag, cantimeoutflag);
         }
 }
\ No newline at end of file