 
 // Forward declarations
 DH22Reading readDH22 ();
+void updateState (ControlledValue &variable);
 void getCurrentRuntime (int &days, int &hours, int &minutes, int &seconds);
 void updateAverages (float temp, float humidity);
 void printTime ();

    _numWraparounds = 0;
    _runtimeInSeconds = 0;
    _lastCheckTime = 0;
    _lastTempStateChangeTime = 0;
    _lastHumidityStateChangeTime = 0;
    _tempState = STATE_OFF;
    _humidityState = STATE_OFF;
    
    for (int i = 0; i < 60; ++i) {
      _tempsLastHour[i] = 0;

#include <dht.h> // For reading from the DHT22 Temperature/Humidity sensor

// Expected Arduino Uno Pinout (All OUTPUT except pin 8):
// 0  - None (Rx)
// 1  - None (Tx)
// 2  - LCD RS
// 3  - LCD Enable
// 4  - LCD d4
// 5  - LCD d5
// 6  - LCD d6
// 7  - LCD d7
// 8  - DHT22 (input pin)
// 9  - Refrigerator
// 10 - Heater
// 11 - Humidifier
// 12 - Dehumidifier
// 13 - None

#define UINT32_MAX uint32_t(-1)

