-
Notifications
You must be signed in to change notification settings - Fork 9
/
Thermostat.h
39 lines (38 loc) · 1.03 KB
/
Thermostat.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
// Library to implement a thermostat on the Arduino. Created by Brian Bustin. 2014
#ifndef Thermostat_h
#define Thermostat_h
#include "Arduino.h"
class Thermostat
{
public:
Thermostat(int pinCool, int pinHeat, int pinFan, bool heatPump);
void Control(float temperature, float humidity);
bool CurrentlyRunning();
bool StateChangeAllowed();
int mode;
int tempHysteresis;
int humidityHysteresis;
int humidityOverCooling;
unsigned long minRunTimeMillis;
unsigned long minOffTimeMillis;
int tempSetPoint;
int humiditySetPoint;
float averageTemp;
float averageHumidity;
private:
int _pinCool;
int _pinHeat;
int _pinFan;
bool _heatPump;
float _temperature;
float _humidity;
bool _currentlyRunning;
char* _jsonOutput;
unsigned long _stateChangeMillis;
bool _stateChangeAllowed;
unsigned long _millisSinceLastStateChange();
bool _shortCycleProtection();
void _changePowerState(bool state, bool updateStateChangeMillis);
char* _jsonCreate(float temperature, float humidity, bool stateChangeAllowed);
};
#endif