Wyatt  1.0.1
Hardware.h
1 #pragma once
2 
3 #define RIGHT_MOTOR_ADDRESS ((unsigned char) 0)
4 #define LEFT_MOTOR_ADDRESS ((unsigned char) 1)
5 #define LEFT_ENCODER_ADDRESS ((unsigned char) 2)
6 #define RIGHT_ENCODER_ADDRESS ((unsigned char) 3)
7 
11 struct Hardware
12 {
13  /* A unique byte address */
14  unsigned char address;
15 
16  /* The length of the message (excluding the byte address) */
17  unsigned char messageLength;
18 };
19 
20 /* Comparision function required for maps */
21 bool operator < (const Hardware &a, const Hardware &b);
22 bool operator == (const Hardware &a, const Hardware &b);
23 
24 /* ENSURE HARDWARE IS APPENDED */
25 extern const Hardware HARDWARE_MAP[];
26 
27 /* DECLARE ALL HARDWARE HERE */
28 extern const Hardware H_RIGHT_MOTOR;
29 extern const Hardware H_LEFT_MOTOR;
30 extern const Hardware H_RIGHT_ENCODER;
31 extern const Hardware H_LEFT_ENCODER;