-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPWMDevice.h
39 lines (36 loc) · 945 Bytes
/
PWMDevice.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
/*
* PWMDevice.h
*
* Robovero class header to communicate with an I2C device attached to the Gumstix Robovero expansion board.
*
* This class is basically a conversion of the python code written by Neil
* MacMunn ([email protected]) at Gumstix.
* https://github.com/robovero
*
*
* Andrew C. Smith
* Aerospace Robotics Lab
* Stanford University
*
* v1.1 June 26 2013
*
*/
#ifndef Robovero_H
#include "Robovero.h"
#endif
class PWMDevice
{
Robovero *robo_host;
unsigned int pwm_channel;
unsigned int pwm_pulseWidth;
static bool isPeriodSet; // flag to notify if period has been set
static unsigned int pwm_period; // period is used for all PWM signals
public:
void move(unsigned int pwm_command);
PWMDevice(Robovero *host, unsigned int address);
PWMDevice(Robovero *host, unsigned int address, unsigned int period, unsigned int pulse);
~PWMDevice();
private:
void initPWM();
};