Question about gpio pins

Perhaps if you post your code for the existing one you might get a better answer.