-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.h
53 lines (50 loc) · 1.44 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
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "screen.h"
#include "temperature_sensor.h"
#include "clock.h"
#include "relay.h"
#include "buttons.h"
class Controller {
public:
Controller(int temperatureSensorPin, int relayPin, int pin_1, int pin_2, int pin_3, int pin_4, int pin_5, int pin_6);
void init();
void control();
private:
Screen screen;
TemperatureSensor temperatureSensor;
Clock clock;
Relay relay;
Buttons buttons;
int hour;
int temporalHour;
int minute;
int temporalMinute;
int second;
byte dayOfWeek;
float temperature;
float setPoint = 15;
int activeMenu = 1;
int previousMenu = 1;
bool automaticMode = false;
bool boilerOn = false;
int hourOnWeek = 0;
int minuteOnWeek = 0;
int hourOffWeek = 0;
int minuteOffWeek = 0;
int hourOnWeekend = 0;
int minuteOnWeekend = 0;
int hourOffWeekend = 0;
int minuteOffWeekend = 0;
bool modifyingOn = true;
void fixTimeFormat(int *timeUnit, int limit);
void modifySetPoint(float *setPoint, int pressedButton);
void modifyTimes(int *hourOn, int *hourOff, int *minuteOn, int *minuteOff, int pressedButton);
void modifyClockTimes(int *hour, int *minute, int pressedButton);
void controlBoiler();
bool isTimeToControlWeekend();
bool isTimeToControlWeek();
void togleBoiler();
bool isTimeToControl(int onHour, int onMinute, int offHour, int offMinute);
};
#endif