added testing for the setPin function as well as a bool to imediately write the changes out to the register