|
Re: Real time versus normal timing
On the question about the 500 ms delay, that is there only for the case of firing the solenoids. It doesn't affect other threads, and doesn't fire until the motors in this thread are disabled (in one direction) by their limit switches.
The idea of checking every other loop may be a good idea, but we use the status of both limit switches together for an interlock on our catapult. We don't want to launch until both are tripped, or else parts will fly.
If we did that, I guess we could use a shift register to keep the state of the unread one. At that point, we would probably have to speed up the loop, or face problems with our autonomous code. Maybe it wouldn't be a problem, and the benefit of putting less noise on CAN may benefit other parts (drive) more.
Thanks for the suggestion!
|