View Single Post
  #12   Spotlight this post!  
Unread 24-11-2015, 11:09
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,753
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: Using encoder with talon SRX

You are correct. The calls are non-blocking, so they occur as fast as the processor can execute instructions. The Set call simply sets a requested value. It doesn't stop to examine changing inputs.
The subsequent calls are actually measuring how far the wheel travels in the time taken by the processor to execute some number of instructions.

The multiple actions per button press isn't mechanical/electrical bounce, but the limit of human reflexes. Your code needs to do a check:
- Only when button changes state from false to true = perform action
- Not when button = True, or = False, or is changing from True to False
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 24-11-2015 at 11:34.
Reply With Quote