Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / utilities / robot_wireless_relay / motor.h @ 13

History | View | Annotate | Download (691 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
#endif
31

    
32
// Function descriptions can be found in motor.c
33
void motors_init(void);
34
void motor1_set(int direction, int speed);
35
void motor2_set(int direction, int speed);
36
void motors_off(void);
37

    
38
#endif