 //      +-o---o---o---o---o---o---o---o---o---o---o---o---o---o---o-+
 //        |   |       |   |   |  E   D  DP   C   G  D4
 //        |   +--POT--+   |   |
-//        |   |   A       |   |
-//       20K 10K  +-------+   |
-//        |   |               |
-//        +---+---------------+
+//        |   |   A-------+   |
+//        |   +-----R1--------+
+//        +---------R2--------+
+
+#define R1        4700L
+#define R2        10000L
+
+#define MAX_BATTERY   (50*(R1+R2)/R1)
+
 const byte ledPins[] = { /*segA-F+DP=*/ 5, 9, A2, A4, A5, 6, A1, A3, /*dig1-4=*/ 4, 7, 8, A0};
 
 void setup()

    }
}

uint8_t dispMode = 0;

void loop()
{

    Serial.begin(57600);
    pinMode(MODE_PIN, INPUT_PULLUP);

    led7seg.begin(COMMON_CATHODE, LED_DIGITS, ledPins);
    analogReference(DEFAULT);
	  pinMode(LED_BUILTIN, OUTPUT);
    pinMode(A6, INPUT);       // No pullup for A6
    pinMode(A7, INPUT);       // No pullup for A7
    pinMode(2, INPUT_PULLUP);
    pinMode(3, INPUT_PULLUP);
    digitalWrite(2, HIGH);    // Turn on pullup for D2
    digitalWrite(3, HIGH);    // Turn on pullup for D3

