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.
Dependencies: mbed MMA8452Q MS5837 SDFileSystem SCI_SENSOR
Diff: main.cpp
- Revision:
- 10:b2fe6d1dee81
- Parent:
- 9:e4e1d5db0c04
- Child:
- 12:54b498af39df
- Child:
- 14:ed172dec4022
diff -r e4e1d5db0c04 -r b2fe6d1dee81 main.cpp --- a/main.cpp Tue Nov 30 16:01:16 2021 +0000 +++ b/main.cpp Thu Dec 02 14:29:55 2021 +0000 @@ -54,7 +54,7 @@ //Control related functions void thrust_on(float pw, float on_time); //input is pulse width - +//void thrust_off(float pw, float on_time); // turn off pulse width //-------------Main functions----------------------------------------------------------------------------------------- @@ -88,8 +88,10 @@ while(1) { - thrust_on(float pw, float on_time); //turn thruster on for 5 seconds - // put your main control code here + float pw= percent; + float on_time =tim; + thrust_on(pw, on_time); //turn thruster on for 5 seconds + return 0; } } @@ -164,8 +166,7 @@ //// 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) { @@ -181,6 +182,7 @@ //PWM will be kept until time out while(tt.read()<=on_time) { + pc.printf("thruster on?...mack is cool\r\n"); //print check } //stop the timer @@ -191,3 +193,5 @@ } +///void thrust_off(float pw, float on_time) //input is pulse width +// \ No newline at end of file