We are having a problem with our potentiometer code. We essentially are continuously polling the potentiometer, using “GetAverageValue”. This works, but it causes severe problems; the robot will suddenly “hang” and remain unresponsive to user input for 5-10 seconds. This will occur several times each minute, but in between hang periods, the code will operate perfectly.
We initially tried using “GetValue” instead, as we suspected the problem was caused by excessive averaging overloading the C-RIO. However, this did not resolve the problem; the ONLY way we were able to improve the problem was by putting a wait in the loop, polling the potentiometer every .1 seconds. This introduces more lag than we’d like, but it does reduce the hang problem significantly, although it does not eradicate it completely.
Any ideas you might have are much appreciated - we’re stumped.