Library for the PsiSwarm Robot - Version 0.7

Dependents:   PsiSwarm_V7_Blank

Fork of PsiSwarmLibrary by James Hilder

Committer:
jah128
Date:
Sat Oct 15 13:29:37 2016 +0000
Revision:
5:3cdd1a37cdd7
Parent:
4:1c621cb8cf0d
Child:
6:b340a527add9
Initial commit of API Version 7 (fork from version 5)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jah128 0:d6269d17c8cf 1 /* University of York Robotics Laboratory PsiSwarm Library: Motor Functions Header File
jah128 0:d6269d17c8cf 2 *
jah128 0:d6269d17c8cf 3 * File: motors.h
jah128 0:d6269d17c8cf 4 *
jah128 0:d6269d17c8cf 5 * (C) Dept. Electronics & Computer Science, University of York
jah128 0:d6269d17c8cf 6 * James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
jah128 0:d6269d17c8cf 7 *
jah128 5:3cdd1a37cdd7 8 * PsiSwarm Library Version: 0.7
jah128 0:d6269d17c8cf 9 *
jah128 5:3cdd1a37cdd7 10 * October 2016
jah128 0:d6269d17c8cf 11 *
jah128 0:d6269d17c8cf 12 *
jah128 0:d6269d17c8cf 13 */
jah128 0:d6269d17c8cf 14
jah128 0:d6269d17c8cf 15 #ifndef MOTORS_H
jah128 0:d6269d17c8cf 16 #define MOTORS_H
jah128 0:d6269d17c8cf 17
jah128 0:d6269d17c8cf 18 void set_left_motor_speed(float speed);
jah128 0:d6269d17c8cf 19 void set_right_motor_speed(float speed);
jah128 0:d6269d17c8cf 20 void brake_left_motor(void);
jah128 0:d6269d17c8cf 21 void brake_right_motor(void);
jah128 0:d6269d17c8cf 22 void brake(void);
jah128 0:d6269d17c8cf 23 void stop(void);
jah128 0:d6269d17c8cf 24 void forward(float speed);
jah128 0:d6269d17c8cf 25 void backward(float speed);
jah128 0:d6269d17c8cf 26 void turn(float speed);
jah128 0:d6269d17c8cf 27
jah128 0:d6269d17c8cf 28 // New time based functions (library v0.3)
jah128 0:d6269d17c8cf 29 void time_based_forward(float speed, int microseconds, char brake);
jah128 0:d6269d17c8cf 30 void time_based_turn(float speed, int microseconds, char brake);
jah128 0:d6269d17c8cf 31 int time_based_turn_degrees(float speed, float degrees, char brake);
jah128 0:d6269d17c8cf 32 float get_maximum_turn_angle(int microseconds);
jah128 0:d6269d17c8cf 33 int get_time_based_turn_time(float speed, float degrees);
jah128 0:d6269d17c8cf 34 void IF_check_time_for_existing_time_based_action();
jah128 0:d6269d17c8cf 35 void IF_end_time_based_action();
jah128 0:d6269d17c8cf 36
jah128 0:d6269d17c8cf 37 void IF_update_motors();
jah128 4:1c621cb8cf0d 38 float IF_calibrated_left_speed(float speed);
jah128 4:1c621cb8cf0d 39 float IF_calibrated_right_speed(float speed);
jah128 0:d6269d17c8cf 40 float IF_calibrated_speed(float speed);
jah128 0:d6269d17c8cf 41 void IF_init_motors(void);
jah128 0:d6269d17c8cf 42
jah128 0:d6269d17c8cf 43 #endif