I am very new to programming but have managed one or two simple things.
This one however is driving me mad. I have a routine (if that's what its called) to drive a motor until a pointer reaches zero (detected by a hall sensor) and then stops. This I have working.
However (obviously) as soon as I drive the pointer forward the condition is false and my pointer reset loop runs returning the pointer to zero.
My question is how can I have the reset pointer loop run just once so when the pointer is at zero it never runs again until the Arduino is reset.
I have searched and read for a few days but cannot find this specific problem. I tried to put the loop into the setup section but, as expected, the loop does not 'loop' simply runs through once.
I apologise if this has been covered before but/and would greatly appreciate being pointed in the right direction. (no pun intended ;) )
thanks in advance