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_ */
BackEMF::BackEMF
BackEMF(int port)
Motor::port
int port() const
Motor::moveRelativePosition
void moveRelativePosition(short speed, int deltaPos)
Motor::moveToPosition
void moveToPosition(short speed, int goalPos)
Motor::moveAtVelocity
void moveAtVelocity(short velocity)
Motor::freeze
void freeze()
Motor::pidGains
void pidGains(short &p, short &i, short &d, short &pd, short &id, short &dd)
Motor::motorPower
void motorPower(int percent)
Motor::forward
void forward()
Motor
Definition: motors.hpp:11
BackEMF
Definition: motors.hpp:50
Motor::clearPositionCounter
void clearPositionCounter()
Motor::blockMotorDone
void blockMotorDone() const
BackEMF::value
int value() const
Motor::off
void off()
Motor::Motor
Motor(int port)
Motor::backward
void backward()
Motor::motor
void motor(int percent)
Motor::isMotorDone
bool isMotorDone() const
BackEMF::port
int port() const
Motor::setPidGains
void setPidGains(short p, short i, short d, short pd, short id, short dd)