Switching 6 output PIN's based on input of 4 other PIN's