My team is having trouble with our potentiometer. We have all three leads conected and we have tested them for voltage and resistence, and both turned up to be fine. We have checks everything over, but we just can’t get the values to print to screen. We are using easyc pro but I typed out the code:
void main( void )
unsigned int PotValues;
PotValues = GetAnalogInput(1);
Can anyone help me here? This just does not seem to be working, We compared this programto those of last years but still has not turned anything up, we also tried using MPLab but still nothing. If anyone can help us out, we would really appreciate it!
Don’t you mean 1 to red, 2 to white, and 3 to black, or 1 to black, 2 to white, 3 to red? Or did I confuse something. I think if you do this, you will release some magic smoke. Please correct me if I’m wrong, I have our potentiometer connected this way and I’m about to connect it tomorrow. Please Please reply.
Your description is confusing. Are you actually having problems with a potentiometer, or is your problem right now just with printing the value being read? It seems to me that your question actually belongs in the Programming forum where someone who knows EasyC might be able to help.
You ae correct: One “end” of the pot goes to black, the other “end” goes to red - this puts a 5 volt potential across the entire pot. You then connect the Wiper of the pot to the white, so the RC can read the voltage at the wiper contact (which varies from 0 to 5 volts). Using the diagram, black goes to 1 or 3, red goes to 3 or 1, and WHITE goes to TWO.