Did you get any warnings about type conversion? I'll have to try it but .....temperature = (temp * 0.48876); might need to be cast!..... temperature = ((float)temp * 0.48876);
I did not get any warning at all. All the readings except current is accurate. temperature = (temp * 0.48876);--------> this is for temperature reading from LM35.( i don't have any difficulty with it).
The only problem is the value for current reading at here .................................>//--------------------------Current Sensor
//sensor D //CURRENT
ADCON0=CHANNEL3; //CHANNEL1=0b10001001 //CHANNEL0 is for Temperature
lcd_goto(48);
read_adc(); ////It seems Reading the adc first ***important ////This function generates the average reading value of ADC
current=read_temp(); // reading value from sensor ***important ////This function stores the generated value by ADC into the variable "temp"
//current=0.074*current; // Last time used for ACS712 Hall Effect sensor and it worked in simulation, but practically now working
//current=(current-34);
current=(current/0.001*1000); //This is the part i am confused about and can't fix a coefficient to get the right value???
current=(current*20);
dis_num(current); //show the value
send_char('.'); //this line is to show . to seprate desimal value from double value
dis_num(current%10); //show the double value
send_char(' ');
send_char('A');
send_char(' ');