markymark31
Member
Hi All,
I'm struggling with a bit of logic and am wondering whether you excellent bunch can help or point me in the right direction ......
Basically i'm using push buttons to manually raise & lower part of a machine. I get an analog value back giving me something I can use for height feedback.
I need to stop the machine at a particular height value (which i can do) but then if i press the button again, i need to allow the machine to continue moving in that same direction.
I don't want to just use an "if height = 3000" (for example) to stop as the feedback from the sensor might miss that particular value and not stop, so instead I am using an "if height > 3000" which guarantees it will stop but this gives me the problem of how to ignore this when the push button is pressed again after the machine stops.
I hope i've explained that okay, all help will be greatly received, thank you
Mark
I'm struggling with a bit of logic and am wondering whether you excellent bunch can help or point me in the right direction ......
Basically i'm using push buttons to manually raise & lower part of a machine. I get an analog value back giving me something I can use for height feedback.
I need to stop the machine at a particular height value (which i can do) but then if i press the button again, i need to allow the machine to continue moving in that same direction.
I don't want to just use an "if height = 3000" (for example) to stop as the feedback from the sensor might miss that particular value and not stop, so instead I am using an "if height > 3000" which guarantees it will stop but this gives me the problem of how to ignore this when the push button is pressed again after the machine stops.
I hope i've explained that okay, all help will be greatly received, thank you
Mark