Pat McC / thruster
Revision:
1:94191f7e9b27
Parent:
0:50cdd1590925
Child:
2:9720f38fae31
--- a/thruster.cpp	Mon Nov 23 14:32:01 2020 +0000
+++ b/thruster.cpp	Mon Nov 23 15:12:08 2020 +0000
@@ -9,7 +9,6 @@
  */
 
 #include "thruster.h"
-#include "mbed.h"
 
 //Instantiation accepts PWM pin and direction of prop blade
 //Direction is -1 or 1.
@@ -22,7 +21,7 @@
     _period=2.5;        // 2.5ms
     set_period(_period); // set period to 2.5ms (400Hz)
     _max=150;           // max PWM value
-    //pc.printf("Thruster: %f\r\n",d);
+    //printf("Thruster: %f\r\n",d);
 }
 
 //Sets Event for Emergency Stop and sets lockout to set_speed() function.
@@ -77,17 +76,6 @@
     return data;
 }
 
-//Accepts adjustment to max value of pw [-500,x] ms for set_speed() function.
-//Returns 1 if successful.
-int Thruster::set_min(double new_min) {
-    int returnval=0;
-    if (new_min>-500) {
-        _min=new_min;
-        returnval=1;
-    }
-    return returnval;
-}
-
 //Accepts adjustment to max value of pw [x,500] ms for set_speed() function.
 //Returns 1 if successful.
 int Thruster::set_max(double new_max) {
@@ -107,7 +95,8 @@
         set_pw(_base_pw);
     }
     else if (abs(speed_pw) > _max) {
-        returnval = 0;
+        //print("max speed exceeded");
+        returnval=0;
     }
     else {
         double tolerance_pw=0.001;