libkipr  1.0.0
motor.h
Go to the documentation of this file.
1 
7 #ifndef _KIPR_MOTOR_MOTOR_H_
8 #define _KIPR_MOTOR_MOTOR_H_
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
21 
28 int gmpc(int motor);
29 
30 
38 
39 
46 void cmpc(int motor);
47 
48 
49 
58 int move_at_velocity(int motor, int velocity);
59 
67 int mav(int motor, int velocity);
68 
69 
80 int move_to_position(int motor, int speed, int goal_pos);
81 
82 
91 int mtp(int motor, int speed, int goal_pos);
92 
101 int move_relative_position(int motor, int speed, int delta_pos);
102 
111 int mrp(int motor, int speed, int delta_pos);
112 
124 void set_pid_gains(int motor, short p, short i, short d, short pd, short id, short dd);
125 
126 
138 void get_pid_gains(int motor, short * p, short * i, short * d, short * pd, short * id, short * dd);
139 
145 int freeze(int motor);
146 
154 
162 
169 void bmd(int motor);
170 
177 int setpwm(int motor, int pwm);
178 
184 int getpwm(int motor);
185 
186 
192 void fd(int motor);
193 
194 
200 void bk(int motor);
201 
202 
211 void motor(int motor, int percent);
212 
222 void baasbennaguui(int motor, int percent);
223 
232 void motor_power(int motor, int percent);
233 
234 
240 void off(int motor);
241 
247 void alloff();
248 
254 void ao();
255 
256 #ifdef __cplusplus
257 }
258 #endif
259 
260 #endif
void motor(int motor, int percent)
Moves a motor at a percent velocity.
int move_at_velocity(int motor, int velocity)
Set a goal velocity in ticks per second.
int get_motor_done(int motor)
Check if the motor has reached it's goal.
int move_relative_position(int motor, int speed, int delta_pos)
Set a goal position (in ticks) for the motor to move to, relative to the current position.
void cmpc(int motor)
Clears the motor position counter.
void bk(int motor)
Moves the given motor backward at full power.
int gmpc(int motor)
Gets the current motor position.
int freeze(int motor)
Active braking to stop a motor.
void block_motor_done(int motor)
Wait until the motor is at it's goal.
void fd(int motor)
Moves the given motor forward at full power.
int get_motor_position_counter(int motor)
Gets the current motor position.
void set_pid_gains(int motor, short p, short i, short d, short pd, short id, short dd)
Set the motor PID gains, represented as fractions.
void motor_power(int motor, int percent)
Moves a motor at a percent power.
int mrp(int motor, int speed, int delta_pos)
Set a goal position (in ticks) for the motor to move to, relative to the current position.
void off(int motor)
Turns the specified motor off.
void clear_motor_position_counter(int motor)
Clears the motor position counter.
void bmd(int motor)
Wait until the motor is at it's goal.
void get_pid_gains(int motor, short *p, short *i, short *d, short *pd, short *id, short *dd)
Set the motor PID gains, represented as fractions.
int mav(int motor, int velocity)
Set a goal velocity in ticks per second.
void baasbennaguui(int motor, int percent)
Moves a motor at a percent velocity.
void alloff()
Turns all motors off.
int getpwm(int motor)
Get the current motor pwm command.
void ao()
Turns all motors off.
int setpwm(int motor, int pwm)
Set the motor pwm (percent power) command.
int mtp(int motor, int speed, int goal_pos)
Set a goal position (in ticks) for the motor to move to.
int move_to_position(int motor, int speed, int goal_pos)
Set a goal position (in ticks) for the motor to move to.