-
Notifications
You must be signed in to change notification settings - Fork 0
/
Servo.hpp
44 lines (35 loc) · 652 Bytes
/
Servo.hpp
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
/*
* FILENAME: Servo.hpp
* AUTHOR: Josh Trzebiatowski <trzebiatowskj@msoe.edu>
* DATE: April 10, 2015
*/
#ifndef SERVO_HPP
#define SERVO_HPP
#include "PWM.hpp"
/*
* Servo class, extension of PWM class, provides access
* to PWM methods
*/
class Servo : public PWM {
private:
int pos;
protected:
public:
/*
* Constructor, which half of the Servo module to control
*/
Servo(PWMIndex index);
/*
* Constructor, initial position
*/
Servo(PWMIndex index, float position);
/*
* Sets position as a value from 0.0 to 1.0
*/
void setPosition(float position);
/*
* Gets the set position
*/
float getPosition();
};
#endif