|
Re: "Squaring" robot
Attached are some simplified examples (didn't create the sensors, just made some variables for distance) that show what I mean.
Each case structure can "interrupt" the one before it, with the last one having priority. In this example, the last case structure is the "In Range" detection that keeps you from moving if you're centered enough.
*Some other small notes:
-It's better to get the references to motors/sensors once outside the loop and use them many times inside the loop. Calling into the refnum registry can be expensive if you're doing it all the time.
-Where does this code live? You said it's inside some other VI.
|