mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
+ minor issues
This commit is contained in:
parent
7730415547
commit
680ccbc1cc
@ -1,4 +1,4 @@
|
|||||||
//
|
//
|
||||||
// FILE: StopWatch.cpp
|
// FILE: StopWatch.cpp
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// VERSION: 0.1.03
|
// VERSION: 0.1.03
|
||||||
@ -7,13 +7,13 @@
|
|||||||
// The library is based upon millis() and therefore
|
// The library is based upon millis() and therefore
|
||||||
// has the same restrictions as millis() has wrt overflow.
|
// has the same restrictions as millis() has wrt overflow.
|
||||||
//
|
//
|
||||||
// HISTORY:
|
// HISTORY:
|
||||||
// 0.1.00 - 2011-01-04 initial version
|
// 0.1.00 - 2011-01-04 initial version
|
||||||
// 0.1.01 - 2011-01-04 Added better state
|
// 0.1.01 - 2011-01-04 Added better state
|
||||||
// 0.1.02 - 2011-06-15 Added state() + #defines + lib version
|
// 0.1.02 - 2011-06-15 Added state() + #defines + lib version
|
||||||
// 0.1.03 - 2012-01-22 Added several improvements
|
// 0.1.03 - 2012-01-22 Added several improvements
|
||||||
// By mromani & Rob Tillaart
|
// By mromani & Rob Tillaart
|
||||||
//
|
//
|
||||||
// Released to the public domain
|
// Released to the public domain
|
||||||
//
|
//
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ StopWatch::StopWatch(enum Resolution res)
|
|||||||
case SECONDS:
|
case SECONDS:
|
||||||
_gettime = seconds;
|
_gettime = seconds;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_gettime = millis;
|
_gettime = millis;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef StopWatch_h
|
#ifndef StopWatch_h
|
||||||
#define StopWatch_h
|
#define StopWatch_h
|
||||||
//
|
//
|
||||||
// FILE: StopWatch.h
|
// FILE: StopWatch.h
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// PURPOSE: Simple StopWatch library for Arduino
|
// PURPOSE: Simple StopWatch library for Arduino
|
||||||
@ -18,14 +18,14 @@
|
|||||||
#include "WProgram.h"
|
#include "WProgram.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class StopWatch
|
class StopWatch
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum State { RESET, RUNNING, STOPPED };
|
enum State { RESET, RUNNING, STOPPED };
|
||||||
enum Resolution { MILLIS, MICROS, SECONDS };
|
enum Resolution { MILLIS, MICROS, SECONDS };
|
||||||
StopWatch(enum Resolution res = MILLIS);
|
StopWatch(enum Resolution res = MILLIS);
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
void reset();
|
void reset();
|
||||||
unsigned long value();
|
unsigned long value();
|
||||||
unsigned long elapsed() { return value(); };
|
unsigned long elapsed() { return value(); };
|
||||||
|
Loading…
Reference in New Issue
Block a user