Pat McC / thruster

thruster.h

Committer:
pmmccorkell
Date:
2020-11-23
Revision:
0:50cdd1590925
Child:
1:94191f7e9b27

File content as of revision 0:50cdd1590925:

/*
 * 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;
};