VEX IQ Brain Refresh Speed

Hey just wondering if anyone the knew the rate the IQ brain refreshes for autonomous. I know in EDR its every twenty milli-seconds is it the same for IQ ?

Thanks in advance :slight_smile:
Arav (1565B)

I guess that would depend on a lot of factors. I seem to remember the Texas Instruments microcontroller being around 80MHz but that’s irrelevant in the context of your question. The different programming languages all work in very different ways and will have a big effect on how your instructions are executed.

We’re using RobotC if that helps.

What is it that you are you trying to work out?

You can use the nPgmTime function in RobotC to determine how long the program has been running (in milliseconds). Create a variable with datatype long and assign the output of nPgmTime to that variable. On each run through the program, print the difference between nPgmTime and the variable from the last loop iteration. Then reset the variable to the current nPgmTime.

This will let you identify how long your loop is taking.

1 Like

Funnily enough I did do this out of interest. I just created an array and kept filling the elements with timer data in a loop. The data in the array incremented by 1mS approximately every 65 elements. This was ROBOTC.
With MODKIT, it seemed to be 24 loops per mS.

I’m pretty sure this information is meaningless though!

The trick is to do this in your full code. Then you have an idea of what your refresh rate looks like as implemented. The more code you have, the slower it will run.

we have a function that needs to update as fast as possible and we were wondering how fast it can

Thank You so much. This should work I will try it when I get home. :))

Ahh, well that depends on what the rest of your program is doing and how much you can optimise it.
Speed is very unlikely to be an issue for you though, just remember that some functions are “blocking” and so this is where you will really need to optimise if you have another thing that needs to update fast and regularly.

1 Like

Thanks for tip what do you mean by “some function are blocking” ?

Some commands wait until they are completed before the next command is executed and some start a command and continue to execute the rest of the program.