libwallaby  v24
The wallaby standard library
motors.hpp
Go to the documentation of this file.
1 /*
2  * motors.hpp
3  *
4  * Created on: Nov 6, 2015
5  * Author: Joshua Southerland
6  */
7 
8 #ifndef INCLUDE_WALLABY_MOTORS_HPP_
9 #define INCLUDE_WALLABY_MOTORS_HPP_
10 
11 class Motor
12 {
13 public:
14  Motor (int port);
15 
16  void clearPositionCounter();
17 
18  void moveAtVelocity(short velocity);
19  void moveToPosition(short speed, int goalPos);
20  void moveRelativePosition(short speed, int deltaPos);
21 
22 #ifndef SWIG
23  void setPidGains(short p, short i, short d, short pd, short id, short dd);
24  void pidGains(short & p, short & i, short & d, short & pd, short & id, short & dd);
25 #endif
26 
27  void freeze();
28 
29  bool isMotorDone() const;
30 
31  void blockMotorDone() const;
32 
33  void forward();
34 
35  void backward();
36 
37  void motor(int percent);
38 
39  void motorPower(int percent);
40 
41  void off();
42 
43  int port() const;
44 
45 private:
46  int m_port;
47 };
48 
49 
50 class BackEMF
51 {
52 public:
53  BackEMF(int port);
54  int value() const;
55  int port () const;
56 private:
57  int m_port;
58 };
59 
60 
61 #endif /* INCLUDE_WALLABY_MOTORS_HPP_ */
Motor(int port)
void backward()
void pidGains(short &p, short &i, short &d, short &pd, short &id, short &dd)
Definition: motors.hpp:11
void off()
void moveAtVelocity(short velocity)
int port() const
void motor(int percent)
void clearPositionCounter()
bool isMotorDone() const
void motorPower(int percent)
void forward()
Definition: motors.hpp:50
void moveRelativePosition(short speed, int deltaPos)
void freeze()
void setPidGains(short p, short i, short d, short pd, short id, short dd)
void blockMotorDone() const
void moveToPosition(short speed, int goalPos)