root / trunk / code / projects / colonet / utilities / robot_slave / servo.h @ 13
History | View | Annotate | Download (671 Bytes)
1 |
|
---|---|
2 |
#ifndef SERVO_H
|
3 |
#define SERVO_H
|
4 |
|
5 |
#include <avr/interrupt.h> |
6 |
|
7 |
|
8 |
#define SERVO_MS 2000 // Number of ticks per ms |
9 |
#define SERVO_PERIOD 0 // Amount of time to wait between pulses |
10 |
#define SERVO_RESET 15000 |
11 |
|
12 |
#define SERVO_MIN 1800 // Smallest pulse length (ticks) |
13 |
#define SERVO_MAX 4200 // Largest pulse length (ticks) |
14 |
|
15 |
#define SERVOPORT1 PORTA
|
16 |
#define SERVOPORT2 PORTC //note that this port will be "backwards", i.e. pin0 is servo 15 |
17 |
|
18 |
#define SERVODDR1 DDRA
|
19 |
#define SERVODDR2 DDRC
|
20 |
|
21 |
#define SERVOMASK1 0x0F |
22 |
#define SERVOMASK2 0x77 |
23 |
|
24 |
void servo_init(void); |
25 |
void servo_set_angle(int servo, int angle); |
26 |
|
27 |
|
28 |
|
29 |
#endif
|