Railway Challenge / Mbed 2 deprecated challenge-RegenBrakingUpdate

Dependencies:   mbed millis

Files at this revision

API Documentation at this revision

Comitter:
cdevarakonda
Date:
Mon Jun 13 09:35:46 2022 +0000
Parent:
23:c25af9a7db8d
Child:
25:1e42ee248b89
Commit message:
In brake code for regen braking, changed motor1.setPark() to motor1.brake(brakeRate); Given the system must be using a motor controller with H bridge PWM and there is an amp circuit for throttle control this should automatically acheieve regen braking

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue May 17 10:53:59 2022 +0000
+++ b/main.cpp	Mon Jun 13 09:35:46 2022 +0000
@@ -67,7 +67,7 @@
   else {//REGEN BRAKING
     if (challenge.regenBrakingActive == true) { // REGEN BRAKING WITH OVERVOLTAGE SAFETY CHECK
       if (brakeRate > 0) {
-        motor1.setPark();
+        motor1.brake(brakeRate);
       }
       else {
         motor1.setForward();