megan gimple / Mbed 2 deprecated OCE360_Final_Project

Dependencies:   mbed MMA8452Q MS5837 SDFileSystem SCI_SENSOR

Revision:
9:e4e1d5db0c04
Parent:
8:cca95817a93b
Child:
10:b2fe6d1dee81
--- a/main.cpp	Tue Nov 30 15:34:44 2021 +0000
+++ b/main.cpp	Tue Nov 30 16:01:16 2021 +0000
@@ -48,12 +48,14 @@
 //IMU related
 void accel_update(); //update accelerometer related variables. we use imu_ticker to call this function
 
+//Control Parameters
+float tim =5;           //define thruster on time
+float percent = 1.2;    //user defined percent of thrust power
+
 //Control related functions
 void thrust_on(float pw, float on_time);  //input is pulse width
 
-//Control Parameters
-float on_time = 5; //on for 5 seconds part one
-float pw=1000;      //pw? //define this? 
+
 
 //-------------Main functions-----------------------------------------------------------------------------------------
 int main()
@@ -83,9 +85,10 @@
     accel_ticker.attach(&accel_update,0.1);  //10Hz
     log_ticker.attach(&log_data,0.5);
     wait(1);
+    
     while(1)
     {
-      thrust_on(); //turn thruster on for 5 seconds
+      thrust_on(float pw, float on_time); //turn thruster on for 5 seconds
       // put your main control code here
     }
 
@@ -161,6 +164,8 @@
 ////                       on_time-> thruster on time.
 void thrust_on(float pw, float on_time)  //input is pulse width
 {
+    float pw= percent;
+    float on_time =tim;
     float pw_max=2.0;
     if(pw>pw_max)
     {