Railway Challenge / Mbed 2 deprecated challenge-2022Fork

Dependencies:   mbed millis

Files at this revision

API Documentation at this revision

Comitter:
cdevarakonda
Date:
Wed Apr 27 11:17:56 2022 +0000
Parent:
13:a9793222af20
Child:
15:4976d145fbd9
Commit message:
Added a state where the current speed and set throttle speed are both zero for the brakes to be on high (i.e. the train must be stationary and will remain that way) It is left commented out for now

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Apr 27 09:04:11 2022 +0000
+++ b/main.cpp	Wed Apr 27 11:17:56 2022 +0000
@@ -301,7 +301,14 @@
           systemOn = false;       // WILL STOP ABOVE HERE NEXT LOOP
           pc.printf("Start Switch is Off\r\n");
         }
-
+        
+        ////Default Brakes on when speed is 0
+        //if(dashboard.getCurrentSpeed() ==0 && motor1.throttle == 0)
+        //{
+         //    brakeValve32 = 0;//(PF_2)
+           //  brakeValve22 = 0;//(PG_1)
+        //}
+        /////////////////////Left it commented out for now  as unsure of the motor throttle check or to use the set speed variable 
         //Set foward
         if (driveMode != 0 && remote.forward == 0) {
           driveMode = 0;