Input switching.......warning, newb.

Hello, does anyone know how I can turn an input into a non constant, i.e. i want basically a limit witch on a motor to work as an input. I have searched but found nothing. I am running PWM on a leonardo with a simple switch pin input high/low, with a fet h bridge.

If I am guessing your needs.

You have a motor you wish to have its position read.
If that is correct then you need to use what they call "Grey Coding"
This will be additional feedback to assist.

But my guess on your question may be wrong..

shawnpepper:
Hello, does anyone know how I can turn an input into a non constant, i.e. i want basically a limit witch on a motor to work as an input.

Analog or digital? In other words, do you just want to detect when the motor reaches the limit of travel or do you want to know how far the motor has turned?