Power and Ground wires are used for axis, plus the axis signal input of each one.

Encoder are two buttons for the controller , so need be wired like the buttons, in the matrix inputs:

http://simhq.com/forum/files/usergals/2014/08/full-37484-85623-pins_common.png
Don't reinventing the wheel. wink

Mix the things and probable result in "chip barbecue", with his peculiar "agreeable" smell. biggrin