forked from rbmj/612-code
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwinch.h
37 lines (34 loc) · 804 Bytes
/
winch.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
#ifndef WINCH_H_INC
#define WINCH_H_INC
#include <SpeedController.h>
#include <AnalogChannel.h>
#include <DigitalInput.h>
#include "pid_controller.h"
class winch {
public:
enum direction_t {
UP,
DOWN,
OFF
};
winch(SpeedController&, AnalogChannel&, DigitalInput&);
~winch();
void enable();
void disable();
bool is_enabled() const;
void set_angle(float);
float get_cur_angle() const;
float get_set_angle() const;
void update();
void manual_control(direction_t);
private:
SpeedController * jag;
AnalogChannel * pot;
DigitalInput * limit;
bool enabled;
float desired_angle;
float desired_pot_voltage;
static float launch_angle_to_voltage(float);
static float voltage_to_launch_angle(float);
};
#endif