add chart + buttons
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user