unsigned int time = 0; // profile seconds unsigned int degrees = 25; // actual oven temp unsigned int Ts_max = 200; // °C unsigned int Ts_min = 150; // °C unsigned int Tp = 260; // 245-260°C unsigned int rampup_rate = 3; // 3°C/s unsigned int preheat_duration = 100; // 60-180s unsigned int tal = 217; // 217°C unsigned int tal_duration = 100; // 60-150s unsigned int peak_duration = 30; // 20-40s unsigned int rampdown_max = 6; // 6°C/s max unsigned int time_max = 480; // 8*60s max byte state; // 0 = start, 1 = preheat, 2 = tal, 3 = max, 4 = rampdown void setup() { pinMode(13, OUTPUT); Serial.begin(9600); } void get_temp() { } void loop() { time = millis() / 1000; // wait a second so as not to send massive amounts of data delay(1000); switch (state) { case 0: if (degrees > Ts_min) { state++; } case 1: break; case 2: break; case 3: break; case 4: break; default: break; } if (degrees > 60) { Serial.print("seconds: "); Serial.println(time); } }