 
 uint8_t bufferCounter = 1;
 
-bool plantLightOn = false;
-bool aquaLightOn = false;
-
-unsigned long lightInterval = 12;
-unsigned long lastTime = millis();
 bool powerIsOn = false;
 
 uint8_t incomingByte;
 
+bool onAuto = true;
+#define autoTime 1 //number of hours until auto mode resumes.
+unsigned long autoTimer = 0;
+
+//run once on start
 void setup() {
   Serial.begin(9600);
   plantLightBuffer[0] = 1791;


#include "OneWire.h"
//analog pins
#define plantLight A0
#define aquaLight A1
#define waterTurbSensor A2
//digital pins
OneWire  ds(2); //water temp sensor
#define RELAY1  3

    //turn lights off
    if(incomingByte == 1){
       digitalWrite(RELAY1,0);
       powerIsOn = false;
    }
    //turn lights on
    if(incomingByte == 2){
       digitalWrite(RELAY1,1);
       powerIsOn = true;
    }
  }
}

//turns on warning leds, should later control temperature.
void SendCommands(){
//  sensor operation
//  lighting
  if(powerIsOn && aquaLightReading < minLightAqua){
    digitalWrite(aquaLed, HIGH);
  }
  if(powerIsOn && plantLightReading < minLightPlant){
    digitalWrite(plantLed, HIGH);
  }
  
