ESP_IOT v2.5
IOT ESP Coding
TimerDelayClass.h
Go to the documentation of this file.
1//
2// TimerDelayClass.hpp
3//
4//
5// Created by Scott Moody on 3/25/25.
6//
7
8#ifndef TimerDelayClass_hpp
9#define TimerDelayClass_hpp
10#include "../../Defines.h"
11
12//! An concrete class
14{
15public:
16 //! constructor
17 TimerDelayClass(float defaultDelayAmountSeconds);
18
19 //! destructor
21
22 //! Data members of class
23 //! Generic config info .. specific the the sensor type
24
25 //!starts delay calculation
26 void startDelay(float delayAmountSeconds);
27
28 //! stops delay
29 void stopDelay();
30
31 //! whether the currently delay is finished, false if not running at all
32 boolean delayFinished();
33
34private:
35 //! local class variables. (Haven't figured out how to hide these in C++)
36 float _defaultDelayAmountSeconds = 0.5;
37
38 //https://forum.arduino.cc/t/getting-a-loop-to-execute-in-a-defined-amount-of-time/919975/3
39
40 //https://www.forward.com.au/pfod/ArduinoProgramming/TimingDelaysInArduino.html
41 //! the time the delay started
42 unsigned long _delayStart;
43 //! true if still waiting for delay to finish
44 boolean _delayRunning = false;
45 //! length of delay
46 float _delaySeconds;
47};
48
49
50#endif /* TimerDelayClass_hpp */
An concrete class.
void startDelay(float delayAmountSeconds)
starts delay calculation
~TimerDelayClass()
destructor
boolean delayFinished()
whether the currently delay is finished, false if not running at all
TimerDelayClass(float defaultDelayAmountSeconds)
constructor
void stopDelay()
stops delay