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