Multitasking efficiency and NXT speed
I am writing a program which needs to check two loops: one is the primary loop which checks sensors and responds; the other one is constantly monitoring (multiple, I think 4) quadrature encoders (and feeding PID).
The encoders should be turning at a maximum of 720 counts per second. I would need to manually increment the encoder count in the code, so I'm thinking about having a task take care of that. I have some trig in the code, and it will only increase. I guess my question is whether the NXT is fast enough to not miss any encoder counts.
If it becomes necessary, will putting a `endTimeSlice();` every-so-often fix the issue? Or is there no way the NXT is quick enough? If so, would 2-bit Gray code provide enough leeway that I could get by? (I only have 2 digital pins available
I am good at, writing choppy sentences, I just noticed.
_________________FTC Team 6424, the 'Oly Cow
- Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).
and also quadrotors. Quadrotors!