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.
Diff: thruster.h
- Revision:
- 0:50cdd1590925
- Child:
- 1:94191f7e9b27
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thruster.h Mon Nov 23 14:32:01 2020 +0000 @@ -0,0 +1,34 @@ +/* + * Thrust class for LPC1768 + * US Naval Academy + * Robotics and Control TSD + * Patrick McCorkell + * + * Created: 2020 Nov 23 + * + */ + +#include "mbed.h" + +class Thruster { + public: + Thruster(PinName pin, float dir); + void setEvent(); + void clearEvent(); + void set_period(double thruster_time); + void set_pw(double thruster_pw); + double get_pw(); + double get_speed(); + int set_min(double new_min); + int set_max(double new_max); + uint32_t thruster_data(); + int set_speed(double pntr); + + protected: + PwmOut _pwm; + PinName _pin; + float _d; + int _lock; + double _max,_min; + double _base_pw, _period; +};