#ifndef HeatingElement_h #define HeatingElement_h #include "Arduino.h" #define HEATING_ELEMENT_DEFAULT_WINDOW_SIZE 1000 #define HEATING_ELEMENT_MAX_WATTAGE 3000.0 // Minimum = 2000.0 #define HEATING_ELEMENT_AC_FREQUENCY_HZ 50.0 //#define HEATING_ELEMENT_MAX_HEAT_PWM_INTEGER 5 //#define HEATING_ELEMENT_MAX_HEAT_PWM_FLOAT 5.0 class HeatingElement { public: HeatingElement( int iOutputPin, int uiOffValue, int uiOnValue ); void shutDown(); double process(); double process( double dWattage ); boolean isStatusElement(); double getWattage(); void setWattage( double dWattage ); double getNullWattage(); double getOneSixthWattage(); double getOneThirdWattage(); double getHalfWattage(); double getTwoThirdWattage(); double getMaxWattage(); private: double ulWattToWindowTime( double ulAppliedWatts ); int _iOutputPin; int _uiOnValue; int _uiOffValue; boolean _bStatusElement; int _iWindowSize; // Time frame to operate in unsigned long _windowStartTime; double _dWattPerPulse; double _dWattage; }; #endif