-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMAPWM.h
49 lines (39 loc) · 808 Bytes
/
AMAPWM.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
44
45
46
47
48
49
#ifndef __AMAPWM__
#define __AMAPWM__
#include "AMADefines.h"
namespace AMACar
{
/*
* Represents a PWM generator
*/
class AMAPWM
{
private:
/*
* The pin which generates the pwm
*/
byte pin;
/*
* The duty cycle of pwm
*/
byte dutyCycle;
public:
/*
* Initializes a PWM with a specified duty cycle on a specified pin
*/
AMAPWM(byte pin, byte dutyCycle);
/*
* Sets a new pin for PWM
*/
void setPin(byte pin);
/*
* Sets a new duty cycle
*/
void setDutyCycle(byte dutyCycle);
/*
* Generates the PWM
*/
void generate();
};
}
#endif