Thank you Dick,
Once again a very informative post.
I now understand why there is no equivalent optimisation function in RobotC
You have certainly helped to clarify my (and I assume many others) understanding of the speed of sensors Vs NXT’s speed of code execution under Robot C.
Just to confirm my understanding. (nb anyone who knows can respond)
If I was to write the following code:
Then, given the 100+ lines of code executed/sec (ignoring the approx 13% overhead for background tasks such as LCD updates, motor and sensor device drivers, etc) I could inadvertently fill 300 or more variables (in the 3 millisecond gap between sensor reads) with the same 1st reading and theoretically the next 300 variable with redundant/repetitive copies of the 2nd reading etc.
If that is the case, it will be very handy to know when trying to average sensor readings (particularly ultrasonic readings at 50 milliseconds).
For example in HoTWiReZ's post above he'll end up averaging 100 copies of the one reading.
Thanks again,
James