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:
- 20:0add93a69df5
- Parent:
- 19:a4afd3a6bdfb
- Child:
- 21:0cc8e3ee53f6
--- a/main.cpp Tue May 17 10:32:46 2022 +0000
+++ b/main.cpp Tue May 17 10:43:19 2022 +0000
@@ -30,8 +30,8 @@
void DisplaySerial(){
std::stringstream displayline;
displayline << "Blackbox# " << " Motor Accelerator: " << motorAccelerator << " Brake 3/2: " << brakeValve32 << " Brake 2/2: " << brakeValve22 << " Speed: " << dashboard.currentSpeed << " Distance: " << dashboard.currentDistance << " Drive Mode: " << driveMode << "\n";
- string disp=displayline.str();
- pc.printf("%s \n",disp);
+ string disp = displayline.str();
+ pc.printf("%s \n", disp.c_str());
}
//Emergency Stop
@@ -367,7 +367,12 @@
/////////////////////////Innovation braking end
//normal throttle control
else {
+ if (remote.throttle == 0 and dashboard.currentSpeed == 0){
+ brakeControl(2);
+ }
+ else {
speedControl(remote.throttle);
+ }
pc.printf("Throttling: %d\r\n", remote.throttle);
}
} // remote.throttle