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.
Dependencies: PinDetect TextLCD mbed
Fork of SunflowerMach1 by
MotorDrivers/Motor.h
- Committer:
- mdraganic
- Date:
- 2013-11-09
- Revision:
- 4:03b68322905f
- Parent:
- 3:bebfc64cefe4
File content as of revision 4:03b68322905f:
#ifndef MOTOR_H
#define MOTOR_H
#include "mbed.h"
#define motorDriveTime 100 // vrijeme koje se motor kreće, u milisekundama.
#define motorPwmPeriod 0.010 // PWM period to 10 ms
#define motorPwmInitDutyCycle 0.5 // PWM initial duty cycle, 50%
#define motorPwmWaitTime 0.02 // PWM wait time in sec.
#define motorPwmChangeSpeed 0.2 // PWM value change
class Motor {
private:
DigitalOut positiveOut, negativeOut;
PwmOut pwmOut;
short direction;
void start();
public:
Motor(PinName, PinName, PinName);
void movePositive();
void moveNegative();
void stop();
bool isMoving();
};
#endif
