Sketch uses 21054 bytes (65%) of program storage space. Maximum is 32256 bytes.
Global variables use 733 bytes (35%) of dynamic memory, leaving 1315 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xd8
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xd8
avrdude: ser_recv(): read error: The I/O operation has been aborted because of either a thread exit or an application request.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xd8
avrdude: ser_drain(): read error: The device does not recognize the command.
Hi @aaditya2324. I'm going to ask you to post the full verbose output from an upload attempt.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open.
Uncheck the box next to Show verbose output during: ☑ compilation in the "Preferences" dialog.
Check the box next to Show verbose output during: ☐ upload.
Click the "OK" button.
Attempt an upload, as you did before.
Wait for the upload to fail.
You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
Open a forum reply here by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the error output from the upload into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
Things got a bit confusing here because another forum user hijacked the topic. The moderator has now removed those posts so we can dedicate this topic exclusively to assisting @aaditya2324.
@aaditya2324 please provide the full verbose upload output by following the instructions I provided in post #2.
The "Access is denied" error happens when the port is open in another application. Only one application can have a serial port open at a time so Arduino IDE can't perform an upload under these conditions.
Check to see whether you have any applications running on your computer that might use the port. If they are, close them and then try the upload again.
If the "Access is denied" error still occurs after that, try restarting your computer. In rare occasions, a glitch causes the port to get stuck open. This is one possible cause of the error. Restarting your computer restores the port to the normal working state and so fixes that particular cause of the error.