Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 16:54c15eaadf88, committed 2020-12-10
- 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: ");