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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
#ifndef ZEPHYR_H_
#define ZEPHYR_H_
#include <main.h>
#define PI 3.14159265L
#define APPLY_THRESH(n,t) if(n < t && n > -t){ n = 0;}
/*
* Comment to disable LCD support.
*/
#define LCD_PORT uart1
#define LCD_RATE 500
#ifdef LCD_PORT
#endif // LCD_PORT
/*
* Comment to disable gyro support.
*/
#define GYRO_PORT 2
#ifdef GYRO_PORT
void zGyroInit(void);
int zGyroGet(void);
void zGyroReset(void);
#endif // GYRO_PORT
/*
* Comment to disable IME support.
*/
#define IME_ENABLE
#ifdef IME_ENABLE
void zIMEInit(void);
#endif // IME_ENABLE
/*
* DRIVE_NORMAL will override tank drive options.
*/
#define DRIVE_JOY 1
#define DRIVE_THRESHOLD 10
//#define DRIVE_NORMAL 3
#define DRIVE_TANK_LEFT 3
#define DRIVE_TANK_RIGHT 2
#define zJoyDigital(j,g,b) joystickGetDigital(j,g,b)
#define zJoyAnalog(j,a) joystickGetAnalog(j,a)
void zMotorSet(const char *, // Motor Name
int, // Desired Speed
unsigned int // Caller ID
);
char zMotorGet(const char *); // Motor Name
void zMotorTake(const char *,unsigned int);
void zMotorReturn(const char *);
#ifdef IME_ENABLE
int zMotorIMEGet(const char *); // Motor Name
int zMotorIMEGetVelocity(const char *); // Motor Name
bool zMotorIMEReset(const char *motor);
#endif // IME_ENABLE
void zDriveUpdate(void);
char zGetDigitalMotorSpeed(unsigned char, // Joystick No.
unsigned char, // Button Group
unsigned char, // Positive Button
unsigned char, // Negative Button
char // Desired Speed
);
#endif // ZEPHYR_H_
|