A atmega128 is being used to monitor humidity


A Atmega128 is being used to monitor humidity inside test chamber 03. The device uses two sensors to have some fault tolerance. They are connected to ADC channels 0 and 1. The program uses the average and maximum error of the two values. Previously the program used interrupts to update the average and the maximum error of the two sensors, but recently the interrupts on the chip stopped working. GLaDOS has asked you to write code to do this with polling instead of interrupts. 
Other notes:
MaxError can only be set to a higher value
The ADC has been initialized like the question above
Using a spin lock to wait for ADSC to clear is ok.

Void updateHumidity(unsigned* maxError, unsigned* ave){

}

main(){
unsigned MaxError = 0;
unsigned Ave = 0;
init();
while(1){
updateHumidity(&MaxError, &Ave);

// Somebody else's problem
}
}

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: A atmega128 is being used to monitor humidity
Reference No:- TGS082877

Expected delivery within 24 Hours