randomskk / followingrobot

C/ASM code for an ARM-based robot with a vision system to follow the user

This URL has Read+Write access

followingrobot / servo.h
100644 25 lines (19 sloc) 0.666 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/************************************************
* FollowingRobot - servo.h
* Control servos on PB8,9
* Header file.
* See README for more details.
***********************************************/
 
#include "stm32f10x_lib.h"
 
//Values found by experimentation to reliably send that servo
// in that direction.
#define SERVO_L_BACKWARD 16800
#define SERVO_L_FORWARD 13800
 
#define SERVO_R_BACKWARD 7500
#define SERVO_R_FORWARD 10200
 
#define SERVO_L 1
#define SERVO_R 2
 
//Send a pulse to a specified servo, moving it
void servo_send_pulse( int servo, int pulse );
 
//Prototype for Delay, defined in main.c, a busy wait loop
void Delay( unsigned long delay );