// Relay.ino
//
// 6 Febrary 2022, Version 1, by Koepel, Public Domain
//
// Using a relay to turn on one of two leds.
//
//Thermostat controls
#include "DHT.h"
#include "Button.h"
#define DHTPIN 7 //Thermostat dedicated port
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
int CN23 = 13;
int CN22 = 12;
int CN21 = 11;
int Valve = 10;
//Start - all 4 are off
//Floor - ON?, OFF, ON, FLOOR
//CWU - ON?, ON, ON, CWU
//Switching to Floor - ON, ON, ON, FLOOR
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
pinMode(CN23, OUTPUT);
pinMode(CN22, OUTPUT);
pinMode(CN21, OUTPUT);
pinMode(Valve, OUTPUT);
dht.begin();
}
void sendHigh(port){
digitalWrite(port, High);
}
void sendlow(port){
digitalWrite(port, Low);
}
void switchToCWU{
digitalWrite( 13, LOW);
digitalWrite(CN22, HIGH);
digitalWrite( 13, LOW);
digitalWrite( 13, LOW);
}
void switchToCO{
}
void loop()
{
float temperature = dht.readTemperature();
//Wait for Power button press
digitalWrite( 13, HIGH);
delay( 600);
digitalWrite( 13, LOW);
delay( 600);
}