I islinux New Member Feb 2, 2009 #21 i used channel 0 as implies in openADC() also 0x0E in the same function Code: OpenADC(ADC_FOSC_4 & ADC_RIGHT_JUST & ADC_2_TAD, ADC_CH0 & // use Channel 0 ADC_INT_OFF & ADC_VREFPLUS_VDD, 0x0E);
i used channel 0 as implies in openADC() also 0x0E in the same function Code: OpenADC(ADC_FOSC_4 & ADC_RIGHT_JUST & ADC_2_TAD, ADC_CH0 & // use Channel 0 ADC_INT_OFF & ADC_VREFPLUS_VDD, 0x0E);
P Pommie Well-Known Member Most Helpful Member Feb 2, 2009 #22 Try casting ReadPr to a float, sampledPR = 5*((float)ReadPR/1023); But, this wouldn't have worked in the simulator anyway. Mike. BTW, I tend not to use the library functions as it takes me longer to work out how to use them than just write my own. Therefore your initialisation could be completely wrong.
Try casting ReadPr to a float, sampledPR = 5*((float)ReadPR/1023); But, this wouldn't have worked in the simulator anyway. Mike. BTW, I tend not to use the library functions as it takes me longer to work out how to use them than just write my own. Therefore your initialisation could be completely wrong.