Hi^^..send my best regard to anyone here!.
I’m seeking for help in my project code..
I been thing about how to modify it for one month de, but still fail to get it…!!
The original code of the “adc” function from this project is merely able to display a sensor output at LCD from 0 to 255..
////////////////////////////////////////////////
ADGO=1;
while(ADGO);
result=ADRESH;
return result;
/////////////////////////////////////////////////
And I wish to display the output range from 0 to 500 or higher!!!! When 5V of output sensor, it can display for 500 or above, and display for 250 when the sensor output is 2.5V.
So when I’ modify the adc function to
////////////////////////////////////////////////////////////////
ADGO = 1;
while(ADGO);
result= ADRESL;
result+= (ADRESH << 8);
return (ADC_VALUE);
////////////////////////////////////////////////////////////////
The output display in LCD goes randomly from 255 to 90 then to 184 when the voltage increase………
Hope anyone here can give me a suggestion on how to modify it….
Here with my attachment full program..!!!
*i'm using HITech C and pic16f877 for this project
I’m seeking for help in my project code..
I been thing about how to modify it for one month de, but still fail to get it…!!
The original code of the “adc” function from this project is merely able to display a sensor output at LCD from 0 to 255..
////////////////////////////////////////////////
ADGO=1;
while(ADGO);
result=ADRESH;
return result;
/////////////////////////////////////////////////
And I wish to display the output range from 0 to 500 or higher!!!! When 5V of output sensor, it can display for 500 or above, and display for 250 when the sensor output is 2.5V.
So when I’ modify the adc function to
////////////////////////////////////////////////////////////////
ADGO = 1;
while(ADGO);
result= ADRESL;
result+= (ADRESH << 8);
return (ADC_VALUE);
////////////////////////////////////////////////////////////////
The output display in LCD goes randomly from 255 to 90 then to 184 when the voltage increase………
Hope anyone here can give me a suggestion on how to modify it….
Here with my attachment full program..!!!
*i'm using HITech C and pic16f877 for this project