-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbid.h
39 lines (38 loc) · 895 Bytes
/
bid.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
class Category {
public:
Category(char color, int minimum = 1024, int maximum = 0, int mean = 0);
int minimum;
int maximum;
int mean;
char color;
bool includes(int);
bool operator==(const Category);
bool operator<(const Category);
bool operator>(const Category);
};
class Motor {
private:
const int _bufferSize;
const int _in1;
const int _in2;
const int _en;
public:
Motor(const int in1, const int in2, const int en, int power, int driveDirection, const int bufferSize);
int driveDirection;
Category** categories;
int * sensorBuffer;
int _power;
int state;
int trend;
int bufferMean;
Category* category;
Category* prevCategory;
void evalutateSensorData(int);
void changeCategory(Category*);
void flushBuffer(int);
int calculateBufferMean();
int getChange();
bool colorHasChanged();
void start();
void stop();
};