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:
- 6:d0ba4c659e9c
- Parent:
- 5:1911475688a8
- Child:
- 8:0fe9f7bde2f9
diff -r 1911475688a8 -r d0ba4c659e9c main.cpp
--- a/main.cpp Wed Apr 13 08:57:28 2022 +0000
+++ b/main.cpp Wed Apr 13 12:39:00 2022 +0000
@@ -67,20 +67,25 @@
}
}
-void emergencyStop() {
+void emergencyStop() { //Emergency Stop Function
// pc.printf("Emergency Stop Active\r\n");
if (emergencyStopActive == false) {
emergencyStopActive = true;
- motor1.disengage(); // Disengage both motors
+ motor1.disengage();
+
+ //Setting brakes to high
+ brakeValve32 = 0;//(PF_2)
+ brakeValve22 = 0;//(PG_1)
+ // Disengage both motors
// motor2.disengage();
- motor1.setPark(); // Clear Motor Directions
+ // motor1.setPark(); Redundancy as disengage function simply calls SetPark // Clear Motor Directions
// motor2.setPark();
- if (rtc_output.read() == 1) {
- rtc.getTriggerCause(); // Get RTC input status
+ if (rtc_output.read() == 1) { //Check RTC pin out
+ rtc.getTriggerCause(); // Get RTC input status
}
}
}
@@ -518,7 +523,7 @@
// pc.printf("ParkMode = %d", inParkMode);
if (inParkMode == false) {
- pc.printf("Train in park mode.\r\n");
+ pc.printf("Train in park mode.\r\n"); //why?
}
if (emergencyStopActive == true && rtc_output.read() == 0) { // Clear emergency stop flag