i can't assig variable to port

Status
Not open for further replies.
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);
 
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.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…