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/Motor.h
- Committer:
- M_souta
- Date:
- 2020-01-20
- Revision:
- 0:db8d4af513c0
- Child:
- 1:5b0303768126
File content as of revision 0:db8d4af513c0:
#ifndef MOTOR_H_
#define MOTOR_H_
#include "mbed.h"
typedef enum dire {
FREE = 0,
FOR = 1,
BACK = 2,
BRAKE = 3,
}dire;
class MOTOR {
public:
//
MOTOR(PinName D1, PinName D2, PinName pwm);
/* direction
FREE
FOR
BACK
BRAKE
*/
/* pwm
pwm is 0 ~ 100(%)
*/
// durection and pwm set
void Dir(dire mode, uint8_t pwm);
// direction set
void Dir(dire mode);
// pwm set
void PWM(uint8_t pwm);
private:
DigitalOut D1_;
DigitalOut D2_;
PwmOut pwm_;
};
#endif //MOTOR_H_