View Single Post
  #6   Spotlight this post!  
Unread 08-02-2012, 08:25
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,795
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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
Reply With Quote