-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMotor.h
More file actions
31 lines (22 loc) · 660 Bytes
/
Motor.h
File metadata and controls
31 lines (22 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef MBED_MOTOR_H
#define MBED_MOTOR_H
#include "mbed.h"
class Motor {
public:
Motor(PinName hMotor1A, PinName hMotor2A, PinName hMotor1B, PinName hMotor2B);
void moveLeft();
void moveRight();
protected:
DigitalOut _hMotor1A; //Motor 1 + terminal
DigitalOut _hMotor2A; //Motor 2 + terminal
DigitalOut _hMotor1B; //Motor 1 - terminal
DigitalOut _hMotor2B; //Motor 2 - terminal
int _motorOn;
int _motorOff;
float _motorOnDuration;
int _numMotorPulseCycleStandard;
int _numMotorPulseCycleMax;
void hMoveCW(int numPulseCycles);
void hMoveCCW(int numPulseCycles);
};
#endif