I'm trying to get the timer to work properly with WebbotLib and having a few probs.
First, this code:
TICK_COUNT start = clockGetus();
TICK_COUNT end = clockGetus();
TICK_COUNT duration = end - start;
TICK_COUNT start = clockGetus();//restart clock
gives me this warning:
../code.h:287: warning: unused variable 'start'
Line 287 is referring to the 'start' in the for loop. The position of it doesn't seem to matter.
Next, I think a clockGetms(); function could be useful (for ms, not us).
Also, what is the best way to print out the timer? I tried this:
But it only prints the timer as a signed long int - meaning it is giving me values from +/-32768 (and overflowing way too fast for what I'm measuring).
Then I tried this:
But it just gives me strange values like 'B5C0'.
I also tried:
but it just does: