Incorrect Loop for Positioning Linear Actuator

How are the switches wired?

Your program reads the switches for less than one microsecond, then, because of the following line, does nothing for 3.5 seconds. So you can't expect the program to be responsive.

delay(3500);

1 Like