  }
 
 
+//current_sense_raw=analogRead(CURRENT_SENSE);  need to figure out how to read this only when the PWM is on.
+ 
  //block interrupts while retreiving the temperature values.
- noInterrupts();
+  noInterrupts();
  int16_t adc_copy=adc_value;
  int16_t temperature_copy=temperature_value;
  int16_t current_sense_raw_copy = current_sense_raw;
- Setpoint = enc; //set the PID loop to our encooder knob value
+ if (in_cradle)
+ {
+  Setpoint = 0; //turn off the power while in the cradle.
+  //pixels.setPixelColor(0, pixels.Color(0,0,10)); // Blue
+ }
+ else
+ {
+  Setpoint = enc; //set the PID loop to our encoder knob value
+  //pixels.setPixelColor(0, pixels.Color(10,0,0)); // Red
+ }
+ //pixels.show(); 
+ //enable interrupts
  interrupts();
  
  //convert to degrees C

   //long time_start = millis();
   Input =adc_value; 
   myPID.Compute();
   Timer1.pwm(LPINA, Output); //100% = 1023 
   //Serial.println(millis()-time_start);
   //TODO: update the PWM duty
   fastDigitalWrite(CS, HIGH);
  }
  //every other interrupt will be a rising edge, we need to keep track of which is which

  */




  // note: the _in array should have increasing values
//multimap2 allows for extrapolation if the input value is outside the bounds of the lookup array
int multiMap2(int val, int* _in, int* _out, uint8_t size)
