Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 3 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
10 years, 3 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.