All the input/output tracking is handled with class members instead of passing pointers to global variables.
41 lines
823 B
C++
41 lines
823 B
C++
#ifndef THERMOCONTROL_h
|
|
#define THERMOCONTROL_h
|
|
|
|
#include <Adafruit_MAX31865.h>
|
|
|
|
enum modes : uint8_t {OFF, AUTOMATIC, MANUAL, OVERFLOW};
|
|
|
|
class thermoControl {
|
|
private:
|
|
Adafruit_MAX31865* RTD;
|
|
double output_pwm;
|
|
double control_temp;
|
|
double hysteresis;
|
|
double max_pwr_threshold;
|
|
int outMax;
|
|
int outMin;
|
|
|
|
modes OpMode;
|
|
|
|
unsigned long SampleTime;
|
|
unsigned long lastTime;
|
|
|
|
public:
|
|
void begin(int8_t, double, double, double, double);
|
|
void begin(int8_t);
|
|
bool Compute();
|
|
double Power();
|
|
void Power(double);
|
|
double Setpoint();
|
|
void Setpoint(double);
|
|
void SetSampleTime(int);
|
|
void SetPowerLimits(double, double);
|
|
void SetHysteresis(double);
|
|
void SetThreshPWR(double);
|
|
void Mode(modes);
|
|
modes Mode();
|
|
modes CycleMode();
|
|
};
|
|
|
|
#endif
|