Use begin() method for temp controller.
This commit is contained in:
parent
a1eb11b81a
commit
f75cbe5f6c
@ -36,7 +36,7 @@ LiquidCrystal_I2C lcd(0x27,20,4);
|
||||
// Internal I/O
|
||||
Adafruit_MAX31865 KettleThermo = Adafruit_MAX31865(kettleRTDCS);
|
||||
slowPWM boilPWM;
|
||||
thermoControl KettleController = thermoControl(&KettleTemp, &KettleSetpoint, &KettleDuty, &ThreshPWR, &Hysteresis);
|
||||
thermoControl KettleController;
|
||||
|
||||
void MessageReceived(char*, byte*, unsigned int);
|
||||
|
||||
@ -115,6 +115,7 @@ void setup() {
|
||||
boilPWM.begin(kettlePWM, PeriodPWM);
|
||||
KettleThermo.begin(MAX31865_3WIRE);
|
||||
|
||||
KettleController.begin(&KettleTemp, &KettleSetpoint, &KettleDuty, config.threshold, config.hysteresis);
|
||||
// if you get a connection, report back via serial:
|
||||
if (Ethernet.linkStatus() == LinkON) {
|
||||
ConnectMQTT();
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <EEPROM.h>
|
||||
#include "thermoControl.h"
|
||||
|
||||
thermoControl::thermoControl(uint8_t* input_temp, uint8_t* setpoint_temp, uint8_t* output_pwm, uint8_t* max_threshold, uint8_t* hysteresis) {
|
||||
void thermoControl::begin(uint8_t* input_temp, uint8_t* setpoint_temp, uint8_t* output_pwm, uint8_t max_threshold, uint8_t hysteresis) {
|
||||
output_pwm = output_pwm;
|
||||
input_temp = input_temp;
|
||||
setpoint_temp = setpoint_temp;
|
||||
@ -14,7 +14,6 @@ thermoControl::thermoControl(uint8_t* input_temp, uint8_t* setpoint_temp, uint8_
|
||||
OpMode = OFF;
|
||||
SampleTime = 100;
|
||||
lastTime = millis()-SampleTime;
|
||||
|
||||
}
|
||||
|
||||
bool thermoControl::Compute() {
|
||||
|
@ -19,7 +19,7 @@ class thermoControl {
|
||||
unsigned long lastTime;
|
||||
|
||||
public:
|
||||
thermoControl(uint8_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*);
|
||||
void begin(uint8_t*, uint8_t*, uint8_t*, uint8_t, uint8_t);
|
||||
bool Compute();
|
||||
void SetSampleTime(int);
|
||||
void SetPowerLimits(uint8_t, uint8_t);
|
||||
|
Loading…
Reference in New Issue
Block a user