 //-----
 
 // milliseconds delay between measuring battery voltage
+//const int VoltageDelay = 1000;
 const int VoltageDelay = 30000;
 
 // stuff for the calibrate action
 const int MinClockOffset = -32000;
 const int MaxClockOffset = +32000;
 const int MaxOffsetDigits = 5;
+
+// battery voltage limits
+const float MaxVoltage = 8.2;   // battery voltage for "100% full"
+const float MinVoltage = 6.4;   // battery voltage for "0% full"
 
 // macro to get number of elements in an array
 #define ALEN(a)    (sizeof(a)/sizeof((a)[0]))

          break;
        case vfo_HoldClick:
          LcdBrightness = old_brightness;
          event_flush();
          return;
        default:

    UINT measured = analogRead(mc_BattVolts);
    MeasuredVoltage = ((3.3 * measured) / 1023) * (32.0/10.0);

#if (DEBUG & DEBUG_BATT)
      Serial.printf(F("raw volts=%d\n"), measured);
#endif

    // figure out which battery symbol to use
    if (MeasuredVoltage < MinVoltage)
    {
        BatterySymbol = battunder;
        if (MeasuredVoltage < 1.0)
        {
          BatterySymbol = battnone;
        }
    }
    else if (MeasuredVoltage > MaxVoltage)
        BatterySymbol = battover;
    else
    {
      int percent = (int) ((MeasuredVoltage - MinVoltage) / (MaxVoltage - MinVoltage) * 100.0);
      int batt_bucket = (int) (percent/20);
      BatterySymbol = batt_syms[batt_bucket + 2];
#if (DEBUG & DEBUG_BATT)
      Serial.printf(F("actual volts=%f, percent=%d, batt_bucket=%d\n"),
                      MeasuredVoltage, percent, batt_bucket);
#endif
    }
    display_battery();
  }
