PaulRB:
Why didn't you ask for help with the coding, instead of making the hardware more complex, and then asking for help with that? This is what's known as an "X-Y" problem. You are asking for help with Y when what you really need help with is X.
he was asking