|
Re: Programming loop for limiter swith
I tend to use polling for slow sensors like mechanical limit switches. It helps debounce them to sample at the 20ms Teleop rate (or greater in Periodic Tasks). Mechanical switches tend to flicker a little as they are engaging and can produce phantom counts if your data acquisition is too fast.
The Counters are a necessity for fast sensors, like a light sensor watching a spinning shooter wheel.
Be aware there have been some issues reported with Counters that haven't been tracked down, so test the application if you use them. If they pass a test they should be fine.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
|