-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefines.h
71 lines (53 loc) · 1.52 KB
/
defines.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Global defines for program
// basically constants such as pinouts, and various params
// for tweaking
#pragma once
//
// General Constants and params
//
#define SEESAW_HOME_TURN_SPD 140
#define GAME_TIMEOUT_MSEC 120000 // two minutes
#define LINE_KP 4 // * 1/8
#define LINE_KD 12
#define LINE_POS_SCALE 100
#define LINE_SENSOR_MIN_THRES 800
#define LINE_SENSOR_MAX_THRES 135
#define LINE_FOLLOW_UPDATE_PERIOD 2 // 2ms period, 500Hz control rate
#define MOTOR_FULL_POWER_TIME 5 // time to give motors full power initially (msecs)
#define MOTOR_STOP_TIME_TURN 20 // time to give motors full power reverse for stop, when doing a pivot turn (msecs)
#define MOTOR_STOP_TIME_FWD 45 // time to give motors full power reverse for stop, when moving forward/back (msecs)
#define STOP_PAUSE_TIME 900
//
// Timers, allocate so that modules don't clash on timer use
//
#define MOTOR_TIMER 1
#define LINE_FOLLOW_TIMER 2
#define SERVO_TIMER 3
#define MAIN_TIMER 4
//
// Pins
//
//TOGGLE SWITCHES
#define WALL_SENSOR 8
#define TOKENS_LOADED 9
// MOTOR
#define MOTOR_LEFT_DIR 2
#define MOTOR_LEFT_PWM 3
#define MOTOR_RIGHT_DIR 12
#define MOTOR_RIGHT_PWM 11
// TAPE
#define TAPE_SENSOR_FRONT_LEFT 0
#define TAPE_SENSOR_FRONT_CENTER 1
#define TAPE_SENSOR_FRONT_RIGHT 2
#define TAPE_SENSOR_REAR_LEFT 3
#define TAPE_SENSOR_REAR_CENTER 4
#define TAPE_SENSOR_REAR_RIGHT 5
#define TAPE_SENSOR_SIDE 7
// BEACON
#define HOME_BEACON_SENSOR 4
#define FRONT_SEESAW_SENSOR 5
#define SIDE_SEESAW_SENSOR 6
// SERVO
#define SERVO_PIN 10
// LED
#define LED_PIN 13