Stopwatch library with start, stop, and getTime functions. Returns a 00:00:00 in MM:SS:MS format with a max duration of ~30min per documentation on the Timer class. Can easily be output through an LCD/TFT with printf(stopwatch.getTime());

Dependents:   ProgrammaBasis

Committer:
mdomino
Date:
Mon Jul 16 19:46:34 2012 +0000
Revision:
0:3328857bf625
Stopwatch library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mdomino 0:3328857bf625 1 #include "stdio.h"
mdomino 0:3328857bf625 2 #include "stdlib.h"
mdomino 0:3328857bf625 3 #include "math.h"
mdomino 0:3328857bf625 4 #include "mbed.h"
mdomino 0:3328857bf625 5
mdomino 0:3328857bf625 6 class Stopwatch {
mdomino 0:3328857bf625 7 public:
mdomino 0:3328857bf625 8 Stopwatch();
mdomino 0:3328857bf625 9 ~Stopwatch();
mdomino 0:3328857bf625 10 void start();
mdomino 0:3328857bf625 11 void stop();
mdomino 0:3328857bf625 12 char* getTime();
mdomino 0:3328857bf625 13 void countDown(int startTime);
mdomino 0:3328857bf625 14 private:
mdomino 0:3328857bf625 15 int ms;
mdomino 0:3328857bf625 16 int sec;
mdomino 0:3328857bf625 17 int min;
mdomino 0:3328857bf625 18 char buffer[9];
mdomino 0:3328857bf625 19 Timer sw;
mdomino 0:3328857bf625 20 };