Added conditional logic for setting up reset and shutdown pins as they may not be connected to any of the pins on the arduino.
Added attribution for example code.