avrdude: stk500_getsync() window 10 arduino mega

I'm using windows10 and I tried uploading the sketch to Arduino mega and received this error:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x48
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x6c
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x6c
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x6f
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x21
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x0d
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x0a
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x54
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x49
An error occurred while uploading the sketch

how can I solve it?

Please do this:

  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to “Show verbose output during: compilation”
  • Check the checkbox next to "Show verbose output during: upload
  • Click “OK”
  • Sketch > Upload
  • After the upload fails, you’ll see a button on the right side of the orange bar “Copy error messages” (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

Sketch uses 7182 bytes (22%) of program storage space. Maximum is 32256 bytes.
Global variables use 1056 bytes (51%) of dynamic memory, leaving 992 bytes for local variables. Maximum is 2048 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:\Users\user\AppData\Local\Temp\arduino_build_16218/MegaPN532.ino.hex:i 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x48
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x6c
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x6c
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x6f
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x21
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x0d
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x0a
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x54
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x49

avrdude done.  Thank you.

An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

aralotaibi:

Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

If you are trying to upload to a Mega, then you have the wrong board selected. Select Tools > Board > Arduino/Genino Mega or Mega 2560 and then try uploading again.