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:
- 36:af4fb5f4988a
- Parent:
- 35:2f476d981896
- Child:
- 39:2438bf7f2590
--- a/main.cpp Wed Jun 22 11:14:32 2022 +0000
+++ b/main.cpp Fri Jun 24 09:34:37 2022 +0000
@@ -59,6 +59,8 @@
}
//Motor code
void speedControl(int commandedSpeed) {
+ if (dashboard.currentSpeed<16.00)
+ {
switch (commandedSpeed) {
default:
@@ -108,6 +110,14 @@
motor1.throttle(1.0f);
break;
}
+ }
+ else { // IF OVER 15KPH
+ if (dashboard.currentSpeed < 20.00) { // If speed less than 20 (we cant physically go this fast so any faster is probably compressor noise), cut throttle, otherwise ignore
+ motor1.throttle(0.0f); // COMMENTED AS ALREADY SET 0 IN BRAKECONTROL
+// //brakeControl(1);
+ }
+ }
+
}
///Energy Storage
//energy storage display code