root / branches / library_refactor / projects / colonet / server / manual_control / manualControlRobot / motor.h @ 1390
History | View | Annotate | Download (703 Bytes)
1 |
/*
|
---|---|
2 |
motor.h - Contains the function prototypes for controlling motors
|
3 |
author: Tom Lauwers
|
4 |
*/
|
5 |
|
6 |
#ifndef _MOTOR_H
|
7 |
#define _MOTOR_H
|
8 |
|
9 |
#include <avr/io.h> |
10 |
|
11 |
#define FORWARD 1 |
12 |
#define BACKWARD 0 |
13 |
|
14 |
#ifdef FFPP
|
15 |
|
16 |
#define IN1A PD4
|
17 |
#define IN1B PD5
|
18 |
#define IN2A PD6
|
19 |
#define IN2B PD7
|
20 |
|
21 |
/* truth table for this robot (w/ 17529 and nand gates)
|
22 |
PWM !A !B M+ M-
|
23 |
L X X Z Z - coast
|
24 |
H 0 0 Z Z - coast
|
25 |
H 0 1 1 0 - forward
|
26 |
H 1 0 0 1 - backward
|
27 |
H 1 1 0 0 - fast brake
|
28 |
|
29 |
*/
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
#endif
|
35 |
|
36 |
// Function descriptions can be found in motor.c
|
37 |
void motors_init(void); |
38 |
void motor1_set(int direction, int speed); |
39 |
void motor2_set(int direction, int speed); |
40 |
void motors_off( void ); |
41 |
|
42 |
|
43 |
#endif
|