We'd need more details on your project to help out with any code. You mentioned 6 positions but only one position has a sensor. I hope you're not expecting a lot of accuracy on those other positions.
What is it for? Why does it move? What makes it decide to move or stand still?
Post the code you have, in code tags. Use the full editor, via the "preview" button and use the button that looks like </> to format your code properly.