root / branches / encoders / code / lib / include / libdragonfly / motor.h @ 546
History | View | Annotate | Download (842 Bytes)
1 | 7 | bcoltin | /**
|
---|---|---|---|
2 | * @file motor.h
|
||
3 | * @brief Contains definitions for controlling the motors
|
||
4 | *
|
||
5 | * Contains definitions and functions for controlling
|
||
6 | * the motors.
|
||
7 | *
|
||
8 | * @author Colony Project, CMU Robotics Club
|
||
9 | * Based on Tom Lauwer's Firefly Library
|
||
10 | **/
|
||
11 | |||
12 | #ifndef _MOTOR_H
|
||
13 | #define _MOTOR_H
|
||
14 | |||
15 | #include <avr/io.h> |
||
16 | /**
|
||
17 | * @addtogroup motors
|
||
18 | * @{
|
||
19 | **/
|
||
20 | |||
21 | /** @brief make the motors go forwards **/
|
||
22 | #define FORWARD 1 |
||
23 | /** @brief make the motors go backwards **/
|
||
24 | #define BACKWARD 0 |
||
25 | |||
26 | /** @brief Initialize the motors **/
|
||
27 | void motors_init(void); |
||
28 | /** @brief Set speed and direction of motor1 **/
|
||
29 | void motor1_set(int direction, int speed); |
||
30 | /** @brief Set speed and direction of motor2 **/
|
||
31 | void motor2_set(int direction, int speed); |
||
32 | /** @brief Turn the motors off **/
|
||
33 | void motors_off(void); |
||
34 | |||
35 | /**@}**/ // end addtogroup |
||
36 | |||
37 | #endif
|