Sophia, an autonomous robot based on Tamiya kits

Committer:
cylax
Date:
Thu May 09 15:15:31 2013 +0000
Revision:
1:575431135236
Parent:
0:db79273ace80
updated documentation

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cylax 0:db79273ace80 1 #ifndef MBED_SOPHIA_H
cylax 0:db79273ace80 2 #define MBED_SOPHIA_H
cylax 0:db79273ace80 3
cylax 0:db79273ace80 4 #include "mbed.h"
cylax 0:db79273ace80 5 #define FWD 1
cylax 0:db79273ace80 6 #define REV 0
cylax 0:db79273ace80 7 #define LEFT 0
cylax 0:db79273ace80 8 #define RIGHT 1
cylax 0:db79273ace80 9
cylax 0:db79273ace80 10 /** Interface to control a Sophia robot
cylax 0:db79273ace80 11 *
cylax 0:db79273ace80 12 */
cylax 0:db79273ace80 13 class Sophia {
cylax 0:db79273ace80 14 public:
cylax 1:575431135236 15 /** Set the direction of Sophia and the speed of the motor
cylax 1:575431135236 16 *
cylax 1:575431135236 17 * @param speed The speed of the motor as a normalised value between -1.0 and 1.0
cylax 1:575431135236 18 * @param direction The desired direction to move the robot, FWD or REV
cylax 1:575431135236 19 */
cylax 1:575431135236 20 void move(float speed, int direction);
cylax 1:575431135236 21
cylax 1:575431135236 22 /** Sets the side to turn and the speed of the motor
cylax 0:db79273ace80 23 *
cylax 0:db79273ace80 24 * @param speed The speed of the motor as a normalised value between -1.0 and 1.0
cylax 1:575431135236 25 * @param direction The desired direction to move the robot, LEFT or RIGHT.
cylax 0:db79273ace80 26 */
cylax 1:575431135236 27 void turn(float speed, int direction);
cylax 1:575431135236 28
cylax 1:575431135236 29 /** Sets the side to spin and the speed of the motor
cylax 1:575431135236 30 *
cylax 1:575431135236 31 * @param speed The speed of the motor as a normalised value between -1.0 and 1.0
cylax 1:575431135236 32 * @param direction The desired direction to move the robot, LEFT or RIGHT.
cylax 1:575431135236 33 */
cylax 1:575431135236 34 void spin(float speed, int direction);
cylax 0:db79273ace80 35 };
cylax 0:db79273ace80 36
cylax 0:db79273ace80 37 #endif