Multiplexed Seven Segment Display using PIC16F877A and HI-TECH C | eXtreme Electronics
follow that one for the segment display
and for the conversion just go to
C:\Program Files\HI-TECH Software\PICC\9.81\samples\A2Demo
and check out those files.
you need to know where you connect the sensor.
if you check the 16f877 datasheet you can see that it only on the PORTA you can convert Analog to digital if i am not mistaken.
adc_read(unsigned char channel)
ADCON0 = (channel << 3) + 0xC1; // enable ADC, RC osc.
ADGO = 1;
continue; // wait for conversion complete
ADCON0 = (channel << 3) + 0xC1; <--- this is where you tell the pic where to convert the signal.
as i said before check the datasheet and in there there will be 1 or 2 pages about ADCON0 and ADCON1 read them, understand them, get the correct config on your code.
and i believe... it is pretty much at the end your project ;)