Hi,
Thanks for the image, BUT we need a circuit diagram, not a Fritzy image.
Please post a hand drawn diagram with what you are using for a power supply, not a 9V smokedetector battery.
Why have you got BOTH limit switches wired to the SAME pin?
Wire each switch to its own input pin like you had before.
CHANGE;
pinMode(lmswitch1 , INPUT);
pinMode(lmswitch2 , INPUT);
TO:
pinMode(lmswitch1 , INPUT_PULLUP);
pinMode(lmswitch2 , INPUT_PULLUP);
Tom...
![]()