Mark Schwarzer / Mbed 2 deprecated Project_OCE360

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jrschaedler
Date:
Thu Dec 10 14:09:58 2020 +0000
Parent:
14:dc84c793b8b5
Commit message:
final test?

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Dec 08 03:14:00 2020 +0000
+++ b/main.cpp	Thu Dec 10 14:09:58 2020 +0000
@@ -83,16 +83,19 @@
         p_sensor.Barometer_MS5837();
         //Depth Holding
         if (p_sensor.depth()>2.0) {
-            thruster.pulsewidth(1.1/1000.00);
-            thruster2.pulsewidth(1.1/1000.00);
+            pw = 1.1;
+            thruster.pulsewidth(pw/1000.00);
+            thruster2.pulsewidth(pw/1000.00);
         }
         else if(p_sensor.depth()<2.0) {
-            thruster.pulsewidth(1.5/1000.00);
-            thruster2.pulsewidth(1.5/1000.00);
+            pw = 1.5;
+            thruster.pulsewidth(pw/1000.00);
+            thruster2.pulsewidth(pw/1000.00);
         }
         else if(p_sensor.depth()==2.0) {
-            thruster.pulsewidth(1.3/1000.00);
-            thruster2.pulsewidth(1.3/1000.00);
+            pw = 1.3;
+            thruster.pulsewidth(pw/1000.00);
+            thruster2.pulsewidth(pw/1000.00);
         }
     
     if (ttt.read()>=180)
@@ -101,8 +104,9 @@
             //stop the timer
             ttt.stop();
             //turn off the thruster
-            thruster.pulsewidth(1.0/1000.00);
-            thruster2.pulsewidth(1.0/1000.00);
+            pw = 1.0;
+            thruster.pulsewidth(pw/1000.00);
+            thruster2.pulsewidth(pw/1000.00);
     }
  /*
         printf("Pressure: ");