 /***************************************************
                 ArcEyes USB Serial
 ****************************************************/
-
+//settings:
 const int debug = 0;
+const float referenceVolts = 4.94; //set the refrence multiplyer for the volt meter
+unsigned long previousBattCheck = 10000;
 
 if (debug == 1){
    #include <Wire.h>

float speedControl2 = 0; //store the current speed
float speedControl3 = 0; //store the current speed
long previousMillis = 0;  // store the time LCD was last updated
long interval = 50; // time setween lcd updates

struct Status {
  int yaw_pos;

     lcd.print(inputString);
  }
}

int battVolt() {
  int val = analogRead(batteryPin); // read the value from the sensor
  float volts = (10 * val * referenceVolts/1023.0) + 1.2 ; // calculate the ratio. add on the voltage drop due to the diode.
  return volts;
  }

void lowBattCheck(){
  unsigned long currentMillis = millis();
  if(currentMillis - previousBattCheck > 10000) {
    int battReading = battVolt();
    switch (battReading) {
      case  18: overBattStatus();                   break;
      case  17: overBattStatus();                   break;
      case  16: overBattStatus();                   break;
      case  15: overBattStatus();                   break;
      case  14: normBattStatus();                   break;
      case  13: normBattStatus();                   break;
      case  12: normBattStatus();                   break;
      case  11: underBattStatus();                  break;
      case  10: underBattStatus();                  break;
      case   9: underBattStatus();                  break;
      case   8: underBattStatus();                  break;
      case   7: underBattStatus();                  break;
      case   6: underBattStatus();                  break;
      default: break;
    }
  }
}

void overBattStatus() {
  //
  digitalWrite(lowBattLED, HIGH);
  lowBattCon = 1;
}

void normBattStatus() {
//
   digitalWrite(lowBattLED, LOW);
  lowBattCon = 0;
}

void underBattStatus() {
//
   digitalWrite(lowBattLED, HIGH);
   lowBattCon = 1;
}
