Hi Richard,

thanks so much for your help and time. I need to read carefully your code and understand it.

right now i'm testing the circuit.

The unused pins either i will pull them up with a resistors, or i will make ports outputs and set them to low.

I see in your code you have made those unused pins as inputs.