avrdude error - stk500_getsync(): not in sync: resp=0xff
By default, an Arduino Uno automatically resets itself whenever the host computer opens its serial port. After that, the boot loader waits for a few seconds to see whether there is any serial traffic intended for it, and that disrupts the communication sent by avrdude.

You’ll have to disable this auto-reset by connecting a 10µF capacitor between the RESET and GND pins (- going to GND, of course).