avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x31

make sure you don't have wires in pins 1 and 0, these are used for communication.