-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsstimer.h
33 lines (30 loc) · 810 Bytes
/
sstimer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
Title: Simple Switch Timer
Library: sstimer.h
Description:
Created Date: January 17, 2015
Created By: Rolly Falco Villacacan
Released into the public domain.
http://www.mvsadnik.com/microcontrollers/
https://www.facebook.com/groups/pinoymikrocontrollerscommunity/
https://www.facebook.com/pages/Pinoy-Mikro-Controllers-Community/1397572657207414
*/
#ifndef sstimer_h
#define sstimer_h
#include "arduino.h"
class sstimer
{
public:
sstimer(int PIN,long unsigned ON_DURATION, long unsigned OFF_DURATION, int NUM_CYCLES);
void check();
void restart();
private:
unsigned long _tsaved;
int _curCycle;
boolean _PIN_STATUS;
int _PIN;
long unsigned _ON_DURATION;
long unsigned _OFF_DURATION;
int _NUM_CYCLES;
};
#endif