Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mypidror1 Motor Map
Revision 7:34118a0098e8, committed 2020-03-13
- Comitter:
- noamnahum
- Date:
- Fri Mar 13 12:35:04 2020 +0000
- Parent:
- 6:13f47e31348d
- Child:
- 8:4b5f04325cbe
- Commit message:
- FOR DROR1;
Changed in this revision
| recive.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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