add chart + buttons

This commit is contained in:
2021-08-18 19:28:11 +02:00
parent babb031649
commit b6f872e19e
8 changed files with 217 additions and 30 deletions

View File

@@ -1,12 +1,32 @@
#include "thermo.h"
Thermocouple *thermocouple = NULL;
void initThermo(void)
uint32_t thermo_lastTime = 0;
double lastTemperature = 0;
// the setup function runs once when you press reset or power the board
void initThermo()
{
Thermocouple *originThermocouple = new MAX6675_Thermocouple(THERM_CL, THERM_CS, THERM_SO);
thermocouple = new SmoothThermocouple(originThermocouple, SMOOTHING_FACTOR);
}
// the loop function runs over and over again forever
void handleThermo(void)
{
// Reads temperature
uint32_t timeNow = millis();
if (timeNow - thermo_lastTime > THERMO_INTERVAL)
{
lastTemperature = thermocouple->readCelsius();
}
}
//delay(100); // optionally, only to delay the output of information in the example.
}
double getTemperature(void)
{
return lastTemperature;
}