/*
Based on a project by Jason Poel Smith
https://www.allaboutcircuits.com/projects/convert-a-vintage-thermostat-into-a-modern-energy-saver/
*/
//Day and Time Variables
bool dayTimeArray [7][24] = {false};
int currentDoW = 0;
int currentHour = 0;
int upButtonPin = 11; //Pin to read positive manual adjustment buttons
int downButtonPin = 10; //Pin to read negative manual adjustment buttons
int upButtonState = 0; //Current state of positive adjustment button
int downButtonState = 0; //Current state of negative adjustment button
unsigned long currentTime = 0; //Milliseconds since start of program
unsigned long secondMarker = 1000; //1000 milliseconds per second
void setup()
{
pinMode(upButtonPin, INPUT);
pinMode(downButtonPin, INPUT);
Serial.begin(9600); //Serial Monitor fuction for debugging and monitoring
}
void loop()
{
bool valor = dayTimeArray [1][1];
upButtonState = digitalRead(upButtonPin); //Check buttons for manual adjustments
downButtonState = digitalRead(downButtonPin); //Check buttons for manual adjustments
if (upButtonState == LOW)
{
dayTimeArray [1][1] = true;
}
if (downButtonState == LOW)
{
dayTimeArray [1][1] = false;
}
Serial.println(valor);
}