9 years, 7 months ago.

object timer.start() is giving a random value and is not incrementing

This is what my code looks like. I want it to count the elapsed time. t.reset(); while(1) { t.start(); uLCD.locate(1,2); uLCD.printf( "%f seconds", t.read() ); }

Question relating to:

1 Answer

9 years, 7 months ago.

Try starting the timer outside the while loop (or also stopping it inside the loop).

I haven't used it before like this, but looking at the source I think the start without a stop effectively also reset the timer.

Accepted Answer