first commit

Dependencies:   mbed MMA8451Q

Revision:
22:08d30ea47111
Parent:
21:9e6ddb590103
Child:
23:4c743746533c
--- a/main.cpp	Fri Oct 29 18:42:13 2021 +0000
+++ b/main.cpp	Wed Nov 03 16:13:02 2021 +0000
@@ -38,7 +38,7 @@
     servo_motor_pwm.write(CENTER_DUTY_CYCLE);
    // controlUpdate.attach(&PID, TI);
     //Start the control systm using a Ticker object
-      steering_control_ticker.attach(&steering_control, 0.02);
+      steering_control_ticker.attach(&steering_control, TI_STEERING);
       motorLoop.attach(&PI,TI);
      fault_detector.attach(&fault_check, 0.003);
       //bt.attach(&btReceive);
@@ -56,10 +56,7 @@
 pc.printf("Hello World!\n");
 bt.printf("Hello World!\n");
 
-//t.start();
-//float time = t.read();
 
- //prints the string to the Tera-Term Console using the Bluetooth object ‘bt’.
  while(1) {
      
      pc.printf("\n\n");
@@ -85,13 +82,10 @@
          case COLLISION :      bt.printf("\r\nFault: COLLISION"); break;
          case LOW_VOLTAGE : bt.printf("\r\nFault: LOW VOLTAGE");  break;
           }
-         /* bt.printf("\n\n----"); 
-          bt.printf("\n\rLandmark counter : %d", counter);
-          bt.printf("\n\rLandmark restarted : %d", restarted); 
-          bt.printf("\n\rlandmark triggered : %d", landmark_triggered);
+          bt.printf("\n\n----"); 
           bt.printf("\n\rleft distance sensor : %1.6f", left_distance_sensor.read());
-          bt.printf("\n\rRight distance sensor : %1.6f", right_distance_sensor.read()*1.4);
-          bt.printf("\n\rCurrent duty cycle : %f", current_duty_cycle);
+          bt.printf("\n\rRight distance sensor : %1.6f", right_distance_sensor.read());
+         
 
 //pot1Voltage = pot1 * 3.3f;
 //dutyCycleLeft = (pot1 * fullBatScalar);