|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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:
#include "Main.h" void main( void ) { unsigned int PotValues; while (1) { PotValues = GetAnalogInput(1); PrintToScreen("%u\n ,(int)PotValues); } } 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! ![]() |
|
#2
|
|||
|
|||
|
Re: Potentiometer Problems
Well, firstly, are you sure you have the wires connected correctly. There should be a diagram of some sort on the pot itself, that looks like this.
(1)__________________(3) (2)_________| If the diagram isn't on there, the offset pin on the pot will be number 2. Pin 1 goes to white, 2 to red, and 3 to black, on a PWM cable from an Analog Input. Other than that, I don't use easyc and I couldn't tell you if that's the problem. |
|
#3
|
||||
|
||||
|
Re: Potentiometer Problems
Quote:
|
|
#4
|
|||||
|
|||||
|
Re: Potentiometer Problems
Quote:
Don |
|
#5
|
|||
|
|||
|
Re: Potentiometer Problems
Quote:
|
|
#6
|
|||||
|
|||||
|
Re: Potentiometer Problems
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.
|
|
#7
|
||||
|
||||
|
Re: Potentiometer Problems
one thing that I can see that might be problem is you are locking yourself in an infinite while loop which might not be allow the program to print anything.
thats just what i see but, I have not worked with easy c. |
|
#8
|
|||
|
|||
|
Re: Potentiometer Problems
Quote:
Isn't the potentiometer built in to EasyC, there should be a block under Inputs(I think) that says potentiometer that you can use that may help, although the way you are doing it should work fine. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Potentiometer PID | DustinB_3 | Programming | 28 | 15-02-2008 23:18 |
| Potentiometer | fezkazi | Electrical | 3 | 24-01-2007 13:29 |
| Linear Potentiometer | FRC1710 | Motors | 4 | 15-01-2007 19:20 |
| Potentiometer help | Unholy | Programming | 4 | 07-02-2006 17:48 |
| Potentiometer | Joshua May | Technical Discussion | 8 | 22-05-2004 19:51 |