> all black limits together, all black homes together
> i connect 10kohm resistor between the input pin and corresponding wire.

Try adding a separate resistor to each black lead, then linking the free ends of the resistors to the input pin.

Adrian.