I’m looking to drive a Drive motor for 1/8th of a second with the press of a Joystick button. So, here’s what I’ve come up with.
Basically, checking to see if the button is pressed. If not, pass on the set values assigned by the joystick axis. If it’s pressed, substitute the value of -0.8 for 125 iterations, amounting to 1/8th of a second.
Since the Drive Motors will be assigned a value during this time, will I see any watchdog errors?
It’s just a conceptual value to see if I’m understanding the issue/solution at hand. I know that Teleop runs at 20ms, so I’d also be able to do around 6 iterations at a 20ms delay, however I don’t know how Watchdog would respond.
I assume I would start at 1, and keep increasing the delay till Watchdog got unhappy.
The Safety vi defaults to .1sec, so delaying for .125sec will trigger it.
If you feed the Drive motors the same value (-0.8) at a faster rate than .1 sec, then it won’t trip.
You might trip the watchdog. You’ll certainly mess with your drivers, since everything will pause for 1/8 of a second.
Teleop.vi happens pretty regularly. You really can use it as your timing loop. Have some value that passes between each run of Teleop.vi. (Use a feedback node for this.) If the value =0, do nothing and pass your joystick value through. If the value >0, subtract one from it and substitute 0.8 for your joystick value. To trigger it, set the value = 125 (or whatever’s appropriate. I forget the timing of Teleop.vi) if the button is triggered.