This (ADC10 interrupt service routine) is one of the most confusing sections. Here, I sample and do most of the math and averaging calculations regarding room temperature and thermal couple temperature.