Hi Stefan,
“Binary sketch size: 1 108 bytes (of a 30 720 byte maximum)
avrdude: verification error, first mismatch at byte 0x0056
0x7e != 0xfe
avrdude: verification error; content mismatch”
If your connection with the FTDI is not properly secured or sometimes before the completion of the upload, you remove/accidentally touch, it could affect the read back of the flash content during the verification stage of upload. The write stage was completed without error, hence the code runs as you would have expected.
Do you have any example code for how to best utilise the battery voltage monitor connected to pin A6?
Here you go:
float readBattery(void)
{
int count;
int adcValue;
float batteryVoltage;
// Discard 1st reading (inaccurate)
adcValue = analogRead(A6);
adcValue = 0;
// Average battery voltage reading
for (count = 0; count < 10; count++)
{
adcValue += analogRead(A6);
}
adcValue = adcValue / 10;
batteryVoltage = (105.6 * adcValue) / 22528;
return batteryVoltage;
}