Pat McC / thruster

thruster.h

Committer:
pmmccorkell
Date:
2021-04-09
Revision:
4:d32183587460
Parent:
1:94191f7e9b27

File content as of revision 4:d32183587460:

/*
 * 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();
        void set_max(int new_max);
        int get_max();
        uint32_t thruster_data();
        int set_speed(double pntr);

    protected:
        PwmOut _pwm;
        PinName _pin;
        float _d;
        int _lock;
        int _max;
        double _base_pw, _period;
};