|
|
@ -18,13 +18,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*===== Object =====*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ticker heater; |
|
|
|
|
|
|
|
Ticker serial_reporter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*===== Variable =====*/ |
|
|
|
/*===== Variable =====*/ |
|
|
|
//-300: off
|
|
|
|
//-300: off
|
|
|
|
double temp1_current = 0; |
|
|
|
double temp1_current = 0; |
|
|
@ -37,7 +30,6 @@ boolean stringComplete = false; // whether the string is complete |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*===== Function =====*/ |
|
|
|
/*===== Function =====*/ |
|
|
|
|
|
|
|
|
|
|
|
double getTemperature(uint8_t thermistor_pin){ |
|
|
|
double getTemperature(uint8_t thermistor_pin){ |
|
|
@ -152,6 +144,18 @@ void heat_handler(){ |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*===== Object =====*/ |
|
|
|
|
|
|
|
#ifdef WIRELESS_SUPPORT |
|
|
|
|
|
|
|
Ticker heater; |
|
|
|
|
|
|
|
Ticker serial_reporter; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
Ticker heater(heat_handler, 100); |
|
|
|
|
|
|
|
Ticker serial_reporter(serial_report_handler, 500); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*===== Main =====*/ |
|
|
|
/*===== Main =====*/ |
|
|
|
|
|
|
|
|
|
|
|
void setup() { |
|
|
|
void setup() { |
|
|
@ -170,10 +174,18 @@ void setup() { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/*[Ticker Init]*/ |
|
|
|
/*[Ticker Init]*/ |
|
|
|
|
|
|
|
#ifdef WIRELESS_SUPPORT |
|
|
|
heater.attach(0.1, heat_handler); |
|
|
|
heater.attach(0.1, heat_handler); |
|
|
|
#ifndef SERIAL_DEBUG |
|
|
|
#ifndef SERIAL_DEBUG |
|
|
|
serial_reporter.attach(0.5, serial_report_handler); |
|
|
|
serial_reporter.attach(0.5, serial_report_handler); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
heater.start(); |
|
|
|
|
|
|
|
#ifndef SERIAL_DEBUG |
|
|
|
|
|
|
|
serial_reporter.start(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -183,6 +195,9 @@ void loop() { |
|
|
|
//delay(100);
|
|
|
|
//delay(100);
|
|
|
|
#ifdef WIRELESS_SUPPORT |
|
|
|
#ifdef WIRELESS_SUPPORT |
|
|
|
wireless_handler(); |
|
|
|
wireless_handler(); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
heater.update(); |
|
|
|
|
|
|
|
serial_reporter.update(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef SERIAL_DEBUG |
|
|
|
#ifndef SERIAL_DEBUG |
|
|
|