forked from gaelj/thermostat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thermo_control.h
48 lines (41 loc) · 1.03 KB
/
thermo_control.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
#ifndef THERMOSTAT_H
#define THERMOSTAT_H
#include <Arduino.h>
#include <ZUNO_legacy_channels.h>
#include <ZUNO_channels.h>
#include <ZUNO_Definitions.h>
#include <ZUNO_DHT.h>
#include <PID_v1.h>
#include <PID_AutoTune_v0.h>
#include "settings.h"
#include "pinout.h"
#include "utilities.h"
#include "autopid.h"
#define SAMPLE_TIME 20 * 60000 //in ms
#define MIN_CYCLE 3 * 60000 //in ms
#define SWITCH_ON 0xff
#define SWITCH_OFF 0
#define CONTROL_GROUP1 1 // Boiler group
class ThermostatClass {
public:
ThermostatClass(AutoPidClass* autoPid);
int Loop();
void SetBoilerState(bool value);
bool GetBoilerState();
void SetDesiredTemperature(float value);
float GetDesiredTemperature();
float GetRealTemperature();
float GetRealHumidity();
private:
AutoPidClass* AutoPid1;
bool currentBoilerState;
float realTemp;
float realHum;
float Input;
float Output;
float Setpoint;
float windowSize;
unsigned long windowStartTime;
float OutputForWindow;
};
#endif // THERMOSTAT_H