 {
 	digitalWrite(HEATER_PIN, LOW);
   heaterIsOn = false;
-}
-
-float getErr()
-{
-  return ( tempZero + tempRiseTarget - tempAvg.getAverage() ) / tempRiseTarget;
-}
-
-float getPos()
-{
-  return ( tempAvg.getAverage() - tempZero ) / tempRiseTarget;
 }
 
 const char comma PROGMEM = ',';

#define TEMP_TO_DUTY_SLOPE 0.1
#define TEMP_TO_DUTY_OFFSET 0.0

#define DRIVE_MAX 100
#define DRIVE_MIN 10

struct SPid
{

  return min(1.0, max(0.0, tempChange * TEMP_TO_DUTY_SLOPE + TEMP_TO_DUTY_OFFSET));
}

float getErr()
{
  return -(tempAvg.getAverage() - tempZero - tempRiseTarget) / tempRiseTarget;
}

float getPos()
{
  return (tempAvg.getAverage() - tempZero) / tempRiseTarget;
}

void heaterOn()
{
	digitalWrite(HEATER_PIN, HIGH);
