nakashima Kohei / take_mbed

motor.hpp

Committer:
hamohamo
Date:
2021-10-13
Revision:
2:d88ff6dda390
Parent:
1:59244694c2bb

File content as of revision 2:d88ff6dda390:

#ifndef take_motor
#define take_motor

#include "mbed.h"

/*INFO
*coreを使わない場合idはなんでもいいです
*setLimitは出力するpidの上限下限を設定できます
*setPwmでpwm出力ができます
*
*/
class Motor{
public:
    Motor(PinName plus,PinName minus,int period,int id);
    ~Motor();
    void setLimit(double max,double min);
    void setPWM(double pwm);
    double get_ID();
private:
    PwmOut *Plus;
    PwmOut *Minus;
    double Max;
    double Min;
    double Pwm;
    int ID;
};

#endif