public constructor
| 44 | //public |
| 45 | //constructor |
| 46 | S_TimedRelay::S_TimedRelay(const __FlashStringHelper *name, byte pinOutput, bool startingState, bool invertLogic, unsigned long onTime, unsigned long offTime, unsigned int numCycles) : |
| 47 | Sensor(name), |
| 48 | m_bCurrentState(startingState), |
| 49 | m_bInvertLogic(invertLogic), |
| 50 | m_lOnTime(onTime), |
| 51 | m_lOffTime(offTime), |
| 52 | m_iNumCycles(numCycles), |
| 53 | m_iCurrentCount(numCycles), |
| 54 | m_lTimeChanged(0), |
| 55 | m_bTimerPending(false) |
| 56 | { |
| 57 | setOutputPin(pinOutput); |
| 58 | if (numCycles < 1) |
| 59 | { |
| 60 | m_iNumCycles = 1; |
| 61 | m_iCurrentCount = 1; |
| 62 | |
| 63 | Serial.println(F("S_TimedRelay:: INVALID Number of Cycles Requested! Must be at least 1. Setting to 1.")); |
| 64 | |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | //destructor |
| 69 | S_TimedRelay::~S_TimedRelay() |