   return temp;
 }
 
-void setSetTemp(float temp) {
-  temp = temp;
-}
+//void setSetTemp(float temp) {
+//  temp = temp;
+//}
 
 float getUpperTempVariance() {
   return upperTempVariance;
 }
 
-void setUpperTempVariance(float upperTempVariance) {
-  upperTempVariance = upperTempVariance;
-}
+//void setUpperTempVariance(float upperTempVariance) {
+//  upperTempVariance = upperTempVariance;
+//}
 
 float getLowerTempVariance() {
   return lowerTempVariance;
 }
 
-void setLowerTempVariance(float lowerTempVariance) {
-  lowerTempVariance = lowerTempVariance;
-}
+//void setLowerTempVariance(float lowerTempVariance) {
+//  lowerTempVariance = lowerTempVariance;
+//}
 
 // declare upperTempLimit and lowerTempLimit
 float upperTempLimit = getSetTemp() + getUpperTempVariance();

// DS3231 Library Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/

#include <DallasTemperature.h>
#include <OneWire.h>
#include <DS3231.h>

// Init the DS3231 using the hardware interface
DS3231  rtc(SDA, SCL);

// Define OneWire pin
#define ONE_WIRE_BUS 8

// Init OneWire
OneWire oneWire(ONE_WIRE_BUS);


  // Initialize the rtc object
  rtc.begin();
  setCurrentTime(10, 0, 0);     // Set the time to 12:00:00 (24hr format)

  //set digital pins as outputs
  pinMode(relay_1, OUTPUT);  
  pinMode(relay_2, OUTPUT);  
  pinMode(relay_3, OUTPUT);  
  pinMode(relay_4, OUTPUT);
  
  //-------( Initialize Pins so relays are inactive at reset)----
  digitalWrite(relay_1, RELAY_OFF);
  digitalWrite(relay_2, RELAY_OFF);
  digitalWrite(relay_3, RELAY_OFF);
  digitalWrite(relay_4, RELAY_OFF);  
      
  delay(4000); //Check that all relays are inactive at 

  // temp setup
  tempSensorsSetup();  
}

void loop() {

  delay (2000);
  turnRelayOn(2, "relay");
  // Wait one second before repeating :)
  delay (1000);
  turnRelayOff(2, "relay");
  delay (2000);

//  t = rtc.getTimeStr();

  Serial.println(rtc.getTimeStr());

//  checkTemp(insideThermometer);
}

void checkTemp(DeviceAddress deviceAddress) {
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println(sensors.getTempCByIndex(0));
  if (sensors.getTempCByIndex(0) >= upperTempLimit) {
    Serial.print("ALARM!! turning heater off.");
    turnRelayOff(relay_1, relay_1_name);
  } else if (sensors.getTempCByIndex(0) <= lowerTempLimit) {
    Serial.print("ALARM!! turning heater on.");
    turnRelayOn(relay_1, relay_1_name);
  }
}

void turnRelayOn(int relay_num, String relay_name) {
  Serial.print(relay_name + " ON");
  Serial.println("");
  digitalWrite(relay_num, HIGH);// set the Relay ON
}

void turnRelayOff(int relay_num, String relay_name) {
  digitalWrite(relay_num, LOW);// set the Relay OFF
  Serial.print(relay_name + " OFF");
  Serial.println("");
}

Time getCurrentTime() {
  // Need the internet connection for this - from the Raspberry Pi?
}

void setCurrentTime(int hours, int minutes, int seconds) {
  rtc.setTime(hours, minutes, seconds);
}

