Quote:
|
Originally Posted by Max Lobovsky
The topic of optimizing code to run faster is a huge one,...
|
In
rohandalvi's case, the appropriate "optimization" is almost certainly just a matter of putting the code somewhere it will run more often than the ~38 Hz communication rate. The touch sensor is "local I/O", and thus ought to be processed in the Process_Data_From_Local_IO() function.
Our simple wheel speed sensor was polled in Process_Data_From_Local_IO(), and the code kept up just fine with a signal that changed every 8 ms under normal conditions. I didn't put in any instrumentation to measure the timing precisely, but I did verify that Process_Data_From_Local_IO() ran at least twice every four milliseconds.