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:
- 28:1086791972d0
- Parent:
- 27:5f801d4ca461
- Child:
- 29:2ed4d9c309fc
--- a/main.cpp Mon Jun 13 11:06:32 2022 +0000
+++ b/main.cpp Wed Jun 15 13:36:11 2022 +0000
@@ -1,6 +1,6 @@
#include <mbed.h>
#include "millis.h"
-
+#include "brakes.h"
#include "definitions.h"
#include "remoteControl.h"
#include "dashboard.h"
@@ -20,6 +20,7 @@
RoundTrainCircuit rtc(rtc_1, rtc_2, rtc_3, rtc_4, rtc_5, rtc_6, rtc_7, rtc_override);
Motor motor1(motorAccelerator, motorBrake, keySwitchM1, directionFwd, directionRev, footswitchM1, seatM1, inchFwdM1, speedLimit2M1, speedLimit3M1);
ChallengeMode challenge(autoStopTrigger, dashboard, remote, motor1);
+Brakes brakes1();
int driveMode = 2; // Drive mode - fwd(0), rev(1), park(2)
bool emergencyStopActive = false;
@@ -63,6 +64,7 @@
motor1.throttle(0.0f);
brakeValve32 = 0;
brakeValve22 = 0;
+ //brakes1.BrakesOn();
}
else {//REGEN BRAKING
if (challenge.regenBrakingActive == true) { // REGEN BRAKING WITH OVERVOLTAGE SAFETY CHECK
@@ -95,7 +97,7 @@
}
//else {
//motor1.setForward();
- //}
+ }
else { // MECHANICAL BRAKING
// int bR=static_cast <int>(brakeRate); //type casting brake rate to int for mechanical cases