What I found to work the best is to make sure you change the code to reflect which pins are connected and to connect the pins to the correct spots for whichever board you are using(IE if it's a MEGA make sure you don't have it wired for an UNO) and to add 1k resistors to the SDA, SCK, MOSI, and RST pins.