 
   //enable the PID loop
   myPID.SetMode(AUTOMATIC);
+  myPID.SetSampleTime(20); //20ms  TODO: don't leave this hard-coded
+  myPID.SetOutputLimits(0,900); //961max PWM, otherwise it will cut into the sample window TODO:dont leave hard coded
 }
 
 void PulsePin(int pin)

   //read back from the ADC while simultaneously changing the config to start a oneshot read of internal temp)
   fastDigitalWrite(CS, LOW);
   adc_value=SPI.transfer16(ADS1118_SINGLE_SHOT_INTERNAL_TEMPERATURE);
   //myPID.Compute(); 
   //TODO: update the PWM duty
   fastDigitalWrite(CS, HIGH);
  }


///////////////

//send-receive with processing if it's time
  if(millis()>next_millis)
  {
    if (Serial.available())
    {
      SerialReceive();
    }
    SendStatusPacket();
    next_millis+=100;
  }
}


