i've been trying to upload a code to my arduino leonardo board where i'm reading the input from a temperature sensor in analog pin 0 and performing some operations on it.
the problem is that the board keeps executing the previous code where i was trying to get the temp in Celsius, and it doesn't execute the new one i'm trying to upload.
i get the following in the msg box but i'm not sure is it's related in any way!:
" avrdude: stk500_getsync(): not in sync: resp=0x31 "
That message is important It means the Arduino IDE cannot communicate with the Leonardo so the upload fails. Hence, the previous program continues to run.
Have you previously uploaded to this Arduino from your computer?
Before you upload, do you select Tools - Board - Leonardo from the Arduino IDE menu?
And from Tools - Serial Port, do you see a COM port for your Leonardo?
Sara91:
the board keeps executing the previous code where i was trying to get the temp in Celsius,
i get the following in the msg box but i'm not sure is it's related in any way!:
" avrdude: stk500_getsync(): not in sync: resp=0x31 "
That error means that your upload is failing. That is why the previous sketch is executing.
http://arduino.cc/en/Main/arduinoBoardLeonardo
"Because of the way the Leonardo handles reset it's best to let the Arduino software try to initiate the reset before uploading, especially if you are in the habit of pressing the reset button before uploading on other boards. If the software can't reset the board you can always start the bootloader by pressing the reset button on the board."
aha!
the issue was probably due to the board selection, i don't know how i missed that ^^"
it's really my first time dealing with arduino, hence the silly mistake