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: challenge.cpp
- Revision:
- 18:d28d458824d4
- Parent:
- 15:4976d145fbd9
- Child:
- 23:c25af9a7db8d
--- a/challenge.cpp Wed May 04 13:52:22 2022 +0000
+++ b/challenge.cpp Tue May 17 10:18:39 2022 +0000
@@ -107,7 +107,7 @@
autoStopInProgress = true; // Flag that auto-stop is in progress and fully autonomous
autoStopCruiseSpeed = _dashboard.currentSpeed; // Set the speed the loco was going at the point of triggering
autoStopThrottle = _remote.throttle;
- whistleValve32 = 1;
+
_dashboard.currentDistance = 0.00f; // Reset the distance-travelled counter to 0
// timeToReachTarget = targetDistance / (autoStopCruiseSpeed * 1000 / 3600); // Time(s) = Distance(m) / Speed(converted to m/s)
decelerationGradient = (autoStopCruiseSpeed - 1) / (targetDistance - 1); // m = y / x → to get to 1kph at 24m, leaving ~ 4 seconds to get to target of 25m