 
     Serial.begin(9600);
     while (!Serial);
+    scan_I2C();
 
     Serial.println("I'm Alive (nano) with LCD");
     sprintf( serial_buf1, "                ");
     sprintf( serial_buf2, "                ");
+    clear_screen();
 }
 
 void loop()

            g_LastButtons.up_button == 0)
        {
            digitalWrite(3, HIGH);
        }
        if ( g_Buttons.bottom_button != 0 &&
            g_LastButtons.bottom_button == 0)
        {
            digitalWrite(3, LOW);
        }
    }
    else if ( mode == MODE_CHARGE)

    lcd.print(line2);
}

long readVcc()
{
    long result;
    // Read 1.1V reference against AVcc
    ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
    delay(2);
    // Wait for Vref to settle
    ADCSRA |= _BV(ADSC);
    while (bit_is_set(ADCSRA, ADSC));
    // Convert
    result = ADCL;
    result |= ADCH << 8;
    result = 1126400L / result; // Back-calculate AVcc in mV
    result += 32; // to match my multimeter
    return result;
}

void scan_I2C(void)
{
    Serial.println ("I2C scanner. Scanning ...");
    byte count = 0;
    Wire.begin();
    for (byte i = 8; i < 120; i++)
    {
        Wire.beginTransmission (i);
        if (Wire.endTransmission () == 0)
        {
            Serial.print ("Found address: ");
            Serial.print (i, DEC);
            Serial.print (" (0x");
            Serial.print (i, HEX);
            Serial.println (")");
            count++;
            delay (1);  // maybe unneeded?
        } // end of good response
    } // end of for loop
    Serial.println ("Done.");
    Serial.print ("Found ");
    Serial.print (count, DEC);
    Serial.println (" device(s).");
}

void setup()
{
    int value = EEPROM.read(eeprom_address);
    if ( value != 0)
    {
        lcd_timeout = value;
    }
    value = EEPROM.read(eeprom_address+1);
    if( value < NUM_MODE_ENUMS)
    {
        mode = value;
    }
    ina219.begin();
    ina219.setCalibration_32V_1A();

    //Initialise the LCD
    lcd.begin (16, 2);
