avrdude error while uploading

OP, try following the steps below:

open you arduino sketch

go to Tools > Processor > and

Choose ATMEGA328P (old bootloader) if by default it was ATMEGA328P or ATMEGA328P if by default it was ATMEGA328P (old bootloader)