#ifndef TOGGLE_H #define TOGGLE_H /** Toggle.h by Matthew Ford, 2020/01/27 (c)2019 Forward Computing and Control Pty. Ltd. NSW, Australia www.forward.com.au */ #include "millisDelay.h" class Toggle { public: // call this first to set pin void togglePinInit(int pinNo); /* setTogglingSpeed call this to change the toggling speed @param mSDelay -- the new delay in milliseconds */ void setTogglingSpeed(unsigned long msDelay); // call this to start toggling void startTogglingPin(); // call this to stop toggling void stopTogglingPin(); // call this from loop() to check if pin should toggle void handleTogglingPin(); private: // private instance variables, each pin gets its own copy of these Stream* debugPtr = NULL; int pin = -1; // set to -1 to indicate not initialized yet bool pinHigh = false; // is the pin is High millisDelay pinToggleDelay; unsigned long PIN_TOGGLE_DELAY_MS = 1000; // on/delay in mS == 1sec default value }; // need to add a ; here !!! #endif // PIN_TOGGLE_H