-
Notifications
You must be signed in to change notification settings - Fork 0
/
AMADcMotor.h
43 lines (37 loc) · 915 Bytes
/
AMADcMotor.h
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
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __AMAMotorController__
#define __AMAMotorController__
#include "AMAPWM.h"
#include "AMAOutputDataBus.h"
#include "AMADefines.h"
namespace AMACar
{
/*
* DC Motor Controller to be used with L298N integrated circuit
*/
class AMADcMotor
{
private:
/*
* The pwm applied on the motor driver
*/
AMAPWM *pwm;
/*
* The direction of the motor
*/
AMAOutputDataBus *directionBus;
public:
/*
* Initializes a DC motor controller with to control a motor on specified
*/
AMADcMotor(byte pwmPin, byte pwmDutyCycle, int busPinsCount, int *busPinsArray);
/*
* Sets the duty cycle to control turation
*/
void setDutyCycle(byte dutyCycle);
/*
* Sets the direction of the motor
*/
void setMovement(byte newMotorMovement);
};
}
#endif