Go Down

Topic: Nice piece of code for endstop mechanical switch? (Read 735 times) previous topic - next topic

cfry999

Hey robot guys. I'm wondering if you could show me the best way to use a mechanical switch as an endstop in a sketch? Exactly the way it works on my 3d printer where the switch stops it, but the motor is still available to move again on command.

PaulS

First question is how is the switch wired to the Arduino?

Reading a switch is trivial - that's what the digitalRead() function does.
The art of getting good answers lies in asking good questions.

Go Up