     Serial.println("    DEBUG_INT\tbit is set");
   if (debug & DEBUG_DISP)
     Serial.println("    DEBUG_DISP\tbit is set");
+#if INC_BATTERY
+  if (debug & DEBUG_BATT)
+    Serial.println("    DEBUG_BATT\tbit is set");
+#endif
 }
 
 //----------------------------------------

#include <LiquidCrystal.h>
#include <EEPROM.h>

// debug bit masks:
#define DEBUG_DDS     (1 << 0)
#define DEBUG_FREQ    (1 << 1)

// Standard Arduino loop() function.
//----------------------------------------

const float MaxVoltage = 8.2;   // battery voltage for "100% full"
const float MinVoltage = 6.4;   // battery voltage for "0% full"

void loop(void)
{
#if INC_BATTERY
  // measure voltage every second
  // we will get a value of 1023 for 3.3 volts
  static UINT last_volts_time = -VoltageDelay;    // millis() value last time we measured
