足回り動かすためのライブラリ

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers motor.hpp Source File

motor.hpp

00001 #ifndef take_motor
00002 #define take_motor
00003 
00004 #include "mbed.h"
00005 
00006 /*INFO
00007 *coreを使わない場合idはなんでもいいです
00008 *setLimitは出力するpidの上限下限を設定できます
00009 *setPwmでpwm出力ができます
00010 *
00011 */
00012 class Motor{
00013 public:
00014     Motor(PinName plus,PinName minus,int period,int id);
00015     ~Motor();
00016     void setLimit(double max,double min);
00017     void setPWM(double pwm);
00018     double get_ID();
00019 private:
00020     PwmOut *Plus;
00021     PwmOut *Minus;
00022     double Max;
00023     double Min;
00024     double Pwm;
00025     int ID;
00026 };
00027 
00028 #endif