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.
Motor.h
00001 #ifndef _MOTOR_H_ 00002 #define _MOTOR_H_ 00003 00004 #include "mbed.h" 00005 #include "Util.h" 00006 00007 //#define PWM_MIN 0.001 00008 #define PWM_MIN 0.1 00009 #define PWM_DT 0.001 00010 00011 class Motor : public PwmOut 00012 { 00013 public: 00014 Motor(PinName pwm, float _period/*, float* linCoef, float lowerSat, float upperSat*/); 00015 //Motor(PinName pwm, float periodms); 00016 00017 void setPower(float power); 00018 void setPowerLin(float power); 00019 void arm(int pwm_ms); 00020 void accumulatePower(float accPower); 00021 00022 float getPower(); 00023 00024 private: 00025 float currentPower; 00026 //float* linCoef; 00027 //float lowerSat, upperSat; 00028 }; 00029 00030 #endif
Generated on Tue Jul 19 2022 01:26:58 by
1.7.2