libkovan  1
The kovan standard library
Motors

Classes

class  Motor
 A motor object that is associated with a physical motor port. More...
 
class  BackEMF
 Allows the reading of the back emf values for each motor. More...
 

Functions

VF EXPORT_SYM int get_motor_position_counter (int motor)
 
VF EXPORT_SYM int gmpc (int motor)
 
VF EXPORT_SYM void clear_motor_position_counter (int motor)
 
VF EXPORT_SYM void cmpc (int motor)
 
VF EXPORT_SYM int move_at_velocity (int motor, int velocity)
 
VF EXPORT_SYM int mav (int motor, int velocity)
 
VF EXPORT_SYM int mtp (int motor, int speed, int goal_pos)
 
VF EXPORT_SYM int mrp (int motor, int speed, int delta_pos)
 
VF EXPORT_SYM void set_pid_gains (int motor, short p, short i, short d, short pd, short id, short dd)
 
VF EXPORT_SYM void get_pid_gains (int motor, short *p, short *i, short *d, short *pd, short *id, short *dd)
 
VF EXPORT_SYM int freeze (int motor)
 
VF EXPORT_SYM int get_motor_done (int motor)
 
VF EXPORT_SYM void block_motor_done (int motor)
 
VF EXPORT_SYM void bmd (int motor)
 
VF EXPORT_SYM int setpwm (int motor, int pwm)
 
VF EXPORT_SYM int getpwm (int motor)
 
VF EXPORT_SYM void fd (int motor)
 
VF EXPORT_SYM void bk (int motor)
 
VF EXPORT_SYM void motor (int motor, int percent)
 
VF EXPORT_SYM void off (int motor)
 
VF EXPORT_SYM void alloff ()
 
VF EXPORT_SYM void ao ()
 

Detailed Description

Function Documentation

VF EXPORT_SYM void alloff ( )

Turns all motors off.

See also
ao
VF EXPORT_SYM void ao ( )

Turns all motors off.

VF EXPORT_SYM void bk ( int  motor)

Moves the given motor backward at full power

Parameters
motorthe motor's port.
VF EXPORT_SYM void block_motor_done ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM void bmd ( int  motor)
Parameters
[in]motorThe motor port.
See also
block_motor_done
VF EXPORT_SYM void clear_motor_position_counter ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM void cmpc ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM void fd ( int  motor)

Moves the given motor forward at full power

Parameters
motorthe motor's port.
VF EXPORT_SYM int freeze ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM int get_motor_done ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM int get_motor_position_counter ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM void get_pid_gains ( int  motor,
short *  p,
short *  i,
short *  d,
short *  pd,
short *  id,
short *  dd 
)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM int getpwm ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM int gmpc ( int  motor)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM int mav ( int  motor,
int  velocity 
)
Parameters
[in]motorThe motor port.
See also
move_at_velocity
VF EXPORT_SYM void motor ( int  motor,
int  percent 
)

Moves a motor at a percent power.

Parameters
[in]motorThe motor port.
[in]percentThe power of the motor, between -100 and 100.
VF EXPORT_SYM int move_at_velocity ( int  motor,
int  velocity 
)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM int mrp ( int  motor,
int  speed,
int  delta_pos 
)
Parameters
[in]motorThe motor port.
See also
move_relative_position
VF EXPORT_SYM int mtp ( int  motor,
int  speed,
int  goal_pos 
)
Parameters
[in]motorThe motor port.
See also
move_to_position
VF EXPORT_SYM void off ( int  motor)

Turns the specified motor off.

Parameters
motorthe motor's port.
VF EXPORT_SYM void set_pid_gains ( int  motor,
short  p,
short  i,
short  d,
short  pd,
short  id,
short  dd 
)
Parameters
[in]motorThe motor port.
VF EXPORT_SYM int setpwm ( int  motor,
int  pwm 
)
Parameters
[in]motorThe motor port.