I downloaded the latest APM: Plane 2.76 code and tried to add the sonar reading to it. I compiled the code using the Arduino IDE and uploaded it successfully to the APM 2.5, for the first time. When, I tried to upload it again, it gave me the following error:
[color=#FF0000]avrdude: verification error, first mismatch at byte 0x3c000
0x29 != 0x08
avrdude: verification error; content mismatch[/color]
I recompiled the original code (APM:Plane 2.76, without any personal modification), and tried to upload it, but it gave the same error.
I tried to compile and upload the ArduCopter code, and it compiled and upload successfully to the board, and for several times.
I don’t know what is the curse with the APM:Plane 2.76 code.
BTW, I tried the same procedure on two different APM boards, and it is giving the same error.
Well I tried the link you gave yesterday and followed it to the letter and the code failed every verify attempt. Looking for a variable that wasn’t assigned??? I forget which one, but it was one of the AP_xxxxxx var’s