|
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.
|