-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLineGlobal.h
82 lines (68 loc) · 2.17 KB
/
LineGlobal.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
72
73
74
75
76
77
78
79
80
81
82
/*Written by Jacob Smith and Matthew Millendorf for Brandeis Robotics club
Provides wrapper functions for the Zumo32U4LineShieldShieldSensors class
April 4 2018
*/
/**
* set up the LineShieldShield header file
*/
#ifndef LineGlobal_h
#define LineGlobal_h
//only compile this class if the board is correct
#ifdef ARDUINO_AVR_UNO
#define NUM_SENSORS 6
//include all of the necessary library to make this one work
#include<Arduino.h>
#include<LineThreshold.h>
#include <ZumoBuzzer.h>
class LineGlobal {
private:
/**
* a LineTheshold object to tell the robot where it is
*/
LineThreshold thresh;
/**
* an array of string representing the regions individual line sensors have seen
*/
String* regionsSeen;
/**
* prints the regions and thresholds arrays for display
*/
void printArrs(String* regions, int* thresholds, int numRegions);
/**
* the number of regions the field has
*/
int numRegions;
/**
* a list of the regions the robot goes through
*/
String* regionsPriority;
public:
/**
* creates a new lineGlobal object, but setElements function must be called for the class to work porperly
*/
LineGlobal();
/**
* sets the object given an array of regions, the number of regions, and whether a serial connection shouold be established
*/
void setElements(String* regions, int numRegions, String regionsSeen[],
bool USB);
/**
*
* @return the region the robot is on
*/
String getRegion();
/**
* displays the region the robot is on and individual sensor values
*/
void displayLineReadings();
/**
* displays the region the robot is on and individual sensor values
*/
void displayLineReadings(String region);
};
#elif defined (DONT_NEED_LINE)
#warning : May lead to "error: 'LineGlobal' does not name a type" ; Program to Board Incompatibility ; One of the libraries you are using will not work with your board ; For more information, go to cse230.artifice.cc/lecture/splitting-code.html
#else
#error : Program to Board Incompatibility ; One of the libraries you are using will not work with your board ; Quick fix: add <#define DONT_NEED_LINE> to top ; For more information, go to cse230.artifice.cc/lecture/splitting-code.html
#endif
#endif