-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathController.h
61 lines (50 loc) · 1.48 KB
/
Controller.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
/*
Controller.h - Library for controlling solar panels by rotating them.
Created by Raido Kalbre, July 4, 2012.
Licensed under GPL v3.
*/
#ifndef Controller_h
#define Controller_h
#include "Arduino.h"
#include <Logging.h>
// EEPROM INDEX CONSTANTS
#define EE_RUNTIME_VARS 6
#define EE_START_H 0
#define EE_START_M 1
#define EE_STOP_H 2
#define EE_STOP_M 3
#define EE_REWIND_H 4
#define EE_REWIND_M 5
#define EE_INTERVAL_H 6
#define EE_INTERVAL_L 7
#define EE_STEP_TIME_H 8
#define EE_STEP_TIME_L 9
class Controller
{
public:
Controller(byte* times/*, int leftOutputPin, int rightOutputPin, int leftEdgePin, int rightEdgePin, int leftButtonPin, int rightButtonPin*/);
boolean runWithBlocking();
String doCommand(String string);
boolean isMoving();
boolean moveLeft(int amount);
boolean moveRight(int amount);
void setAlarms(byte startH, byte startM, byte stopH, byte stopM, byte rewindH, byte rewindM);
int calculateProgress();
void setProperty(int key, byte value);
void setPropertyWord(int key1, int key2, int value);
byte getProperty(int key);
int getPropertyWord(int key1, int key2);
long getInterval();
void setInterval(long interval);
long getStepSize();
void setStepSize(long stepSize);
byte* getTimes();
boolean setTimes(String string);
void setTimestamp(unsigned long t);
private:
String getStatus();
void stop();
void failMsg();
Logging* _logger;
};
#endif