If you have a schematic then that is a good starting point.

You can post the schematic and the forum will be able to give you suggestions if it is workable and as to how to proceed with your code.

Like your other posting, once we see something tangible from you, we can make comments and guide you if you are doing something wrong.