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: millis
Diff: main.cpp
- Revision:
- 16:7c8ef0e0beaa
- Parent:
- 15:4976d145fbd9
- Child:
- 17:a5d9c9a45cbc
--- a/main.cpp Wed Apr 27 20:28:28 2022 +0000
+++ b/main.cpp Wed May 04 13:36:30 2022 +0000
@@ -64,6 +64,7 @@
motor1.throttle(0.0f);
brakeValve32 = 0;
brakeValve22 = 0;
+ inParkMode = true; //This toggle was missing, could be the issue
}
else {//REGEN BRAKING
if (challenge.regenBrakingActive == true) { // REGEN BRAKING WITH OVERVOLTAGE SAFETY CHECK
@@ -322,8 +323,9 @@
if (driveMode == 2) { //place in park mode if selected by driver
//brakeValve32 = 0;//(PF_2) Already placed in the brake code, but didnt work? So will need to double check
//brakeValve22 = 0;//(PG_1)
+ motor1.setPark(); //function set to here instead of after print.
- if (inParkMode == false) {
+ if (inParkMode == true) { //changes from false to true
pc.printf("Train in park mode.\r\n"); //why?
}
@@ -332,8 +334,8 @@
}
led_parkMode = 1;
- inParkMode = true; // Stop above debug print from displaying more than once
- motor1.setPark();
+ // inParkMode = true; // Stop above debug print from displaying more than once // commented out as unsure if needed
+
}
////Drive