Ljubivoj Cvitas
/
SunflowerMach1
Ovo je kopija vertije od Milana
Fork of SunflowerMach1 by
MotorDrivers/Motor.h
- Committer:
- mdraganic
- Date:
- 2013-11-09
- Revision:
- 3:bebfc64cefe4
- Parent:
- 1:3500bf8487d0
- Child:
- 4:03b68322905f
File content as of revision 3:bebfc64cefe4:
#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 move(); bool _isMoving; public: Motor(PinName, PinName, PinName); void movePositive(); void moveNegative(); void stop(); bool isMoving(); }; #endif