Elct Car Team / Mbed 2 deprecated CarLab

Dependencies:   mbed MMA8451Q

Files at this revision

API Documentation at this revision

Comitter:
aalawfi
Date:
Tue Oct 26 17:06:39 2021 +0000
Parent:
15:32a4440ad305
Child:
17:d2c98ebda90b
Commit message:
- Fixed brakes problem. Motors responding well no heating issues. Must fixe PI controller issue still

Changed in this revision

driving.h Show annotated file Show diff for this revision Revisions of this file
state_control.h Show annotated file Show diff for this revision Revisions of this file
--- a/driving.h	Tue Oct 26 16:35:59 2021 +0000
+++ b/driving.h	Tue Oct 26 17:06:39 2021 +0000
@@ -18,13 +18,18 @@
 #define battDividerScalar 4.0;
 
 AnalogIn pot1(PTB2); //was PTB0
+// Motor Left is PTE20 
+// Motor right is pte 21
 PwmOut motorLeft(PTE20); //was PTB1
 PwmOut motorRight(PTE21); //was PTB2
-
+// left is ptb3 
+// right is ptc 2
 AnalogIn speedSensorLeft(PTB3);
 AnalogIn speedSensorRight(PTC2);
 DigitalOut ledRed(LED1);
 AnalogIn battInput(PTC1);
+// left brake is pta12 
+// right brake is pta4
 DigitalOut brakeLeft(PTA12);
 DigitalOut brakeRight(PTA4); //was PTD4
 
--- a/state_control.h	Tue Oct 26 16:35:59 2021 +0000
+++ b/state_control.h	Tue Oct 26 17:06:39 2021 +0000
@@ -29,16 +29,14 @@
 
 void _stop(void){
    steering_enabled =false;
-   // enable_brakes();
-    brakeLeftBool = true;
-    brakeRightBool = true;
+    enable_brakes();
     motor_enabled = false;  
     turn_led(RED); 
  
     }; 
 void _run(void){
     // TODO: realease brakes, start the motors
-    // disable_brakes(); 
+    // 
     brakeLeftBool = false;
     brakeLeftBool = false;
     motor_enabled = true; 
@@ -48,8 +46,7 @@
      // release brakes, turn on steering system, do not start the motor
     
      // disable_brakes();
-    brakeLeftBool = false;
-    brakeLeftBool = false;
+     disable_brakes(); 
     motor_enabled = false;
     setpointLeft = 0.0;
     setpointRight = 0.0;