C# Waiting on a boolean
<p>I have some code in which I am waiting on the current x,y,z position of a motor to be equal to the position I sent to the motors. There is no command to ask the motors directly so I set up a boolean to be set to true when the current.x , current.y, and current.z are equal to my move(x,y,z) numbers. </p>

<p>I have tried several different ideas, first, setting up a timer and on each tick of the timer, check if the values are equal. But with this attempt I can't get the code to wait if they are not equal.</p>

<p>I also tried a recursion method where if the boolean was false, wait some milliseconds and check again. The code said I had infinite recursion and returned a stackoverflow.</p>

<p>How can I wait for the motors to stop moving before sending my next command?</p>

<p>(The only data I can access from the motor is the current position of it)</p>
