18 lines
310 B
C++
18 lines
310 B
C++
#pragma once
|
|
#include <Arduino.h>
|
|
|
|
class Timer {
|
|
private:
|
|
unsigned long duration;
|
|
bool autoRestart;
|
|
|
|
unsigned long currentTime;
|
|
unsigned long endTime;
|
|
bool running;
|
|
|
|
public:
|
|
Timer(unsigned long duration, bool autoRestart);
|
|
void start();
|
|
bool update(unsigned long delta);
|
|
bool isRunning();
|
|
};
|