Hi,
I am newbie to Arduino.... I bought a Mega2560 and a Duemilanove before. Then I tried to make a batteries tester with Arduino. But sometimes I can not upload to Mega2560, but Duemilanove can, with same sketch!!! It will halt up when uploading to Mega2560. I have to un-plug the USB cable and plug again. The 8u2 version is 0001 already.
Following is part of sketch, it has upload problem if I don't comment out the red section.....
Does anyone can give some tips?
Thanks,
ANewbie
void loop() {
switch(mode) {
//---------------------
case STANDBY:
//read button press
if(readPress) {
readPress = 0;
Serial.println("Read back.............");
//-------------------------------------------------------------------------------------!!!
// if(testCount == 0) {
// Serial.println("No record found!!!!");
// }
//-------------------------------------------------------------------------------------!!!
for(int i = 0; i < testCount; i++) {
Serial.print(i);
Serial.print(" ");
for(int j = 0; j < numberOfBattery; j++) {
Serial.print(result[i * numberOfBattery + j]);
Serial.print(" V ");
} //for
Serial.println();
} //for
isRead = 0;
} //if
//Start button means start testing.........
if((startPress == 1) && (isRead == 0)) {
mode = TESTING;
startPress = 0;
sec10 = 0;
seconds = 0;
} else {
startPress = 0;
}
break;
//----------------------
case INITIAL:
.
.
.