#include "Nextion.h" #include NexNumber n0 = NexNumber(0, 8, "n0"); NexSlider h0 = NexSlider(0, 3, "h0"); NexSlider h1 = NexSlider(0, 4, "h1"); int thermo_so_pin = 2; int thermo_cs_pin = A2; int thermo_sck_pin = 4; int temp=20; int heatprev; int heater=5; int motor=6; MAX6675 thermocouple(thermo_sck_pin, thermo_cs_pin, thermo_so_pin); uint32_t heat = 20; uint32_t Speed = 0; NexTouch *nex_listen_list[] = { &h0, &h1, NULL }; void setup() { pinMode(heater, OUTPUT); pinMode(motor,OUTPUT); nexInit(); } void loop() { temp=thermocouple.readCelsius(); h0.getValue(&heat); h1.getValue(&Speed); delay(100); if(heat==heatprev){ n0.setValue(temp); heatprev=heat; } else { n0.setValue(heat); heatprev=heat; } nexLoop(nex_listen_list); delay(100); if(tempheat+5){ digitalWrite(heater,LOW); } if (temp>heat){ analogWrite(motor,Speed); } else if(temp