 }
 #endif // OPEN_LOOP_MODE
 
-#ifdef P_MODE
+#ifdef PID_MODE
 void loop()
 {
   sampleTimeLeft = sampleTime - millis();

  pinMode(HEATER_PIN, OUTPUT);
  heaterOff();
  
//  tempZero = 20.5;
  tempZero = getTempZero();
	temp = getTemperature();
  tempRiseTarget = TARGET;

	pid.init();
	pidDrive = updatePID(&pid, tempZero + tempRiseTarget - temp, temp);
	heaterDutyCycle = DUTY_INIT;

	timeZero = millis();

	return ( sum * 0.0048828125 / (float)TEMPERATURE_DATA_POINT_COUNT - 0.5 ) * 100.0 + 5.0;
}

float tempChangeToDuty(float tempChange)
{
  return min(1.0, max(0.0, tempChange * TEMP_TO_DUTY_SLOPE + TEMP_TO_DUTY_OFFSET));
