![]() |
HELP: analog input
Hey,
I'm trying to get an analog input from my 10 Kohm but all i get is a series of numbers counting downwards and reseting the controller makes it go back from the number in which it stopped instead of the one in which it began... Any suggestions? |
Re: HELP: analog input
Quote:
Otherwise, the best we could offer up is a generic "look at Kevin's code" here: http://www.kevin.org/frc/ response. |
Re: HELP: analog input
printf("Pot %d\r", Get_ADC_Result(1));
|
Re: HELP: analog input
The counting occurs when nothing is connected.
Make sure that the Pot is plugged into the right pin. In Kevin's ADC, #1 is actually analog in #2 (#0 is pin #1). |
Re: HELP: analog input
we did what you said but it still counts.
can any body please send us a working code for the potentiometer using the analog inputs. |
Re: HELP: analog input
Quote:
Potentiometervalue = Get_Analog_Value(rc_ana_in01); |
Re: HELP: analog input
Quote:
-Kevin |
Re: HELP: analog input
We have tried both things, with Kevin's code and it still did not work...
any further suggestions? |
Re: HELP: analog input
Is your potentiometer wired correctly? Red and black to the outer leads, white (signal) to the center? The problem you described only occurs when nothing is plugged in, so make sure you're referencing the correct analog input in your code, that the pot is wired correctly, and that it's not broken (which is kind of hard to do.. test another one?).
|
Re: HELP: analog input
We tested it with a voltmeter and it all good....
|
Re: HELP: analog input
Quote:
|
Re: HELP: analog input
the potentiometers are good like i said...
We have checked it with a voltmeter connecting between the where the white cable connects and where the red one connects and it shows the correct results. We have also tried to change the ports, and neither of them worked... |
Re: HELP: analog input
Quote:
Quote:
A potentiometer on the Robot Controller's analog inputs needs three wires. Black (ground) goes to one end of the pot. Red (+5) goes to the other end of the pot. White (signal) goes to the wiper. |
Re: HELP: analog input
Like i said before...its connected CORRECTLY...
There is another problem... Black goes to left side of potentiometer Red goes to its right leg and white goes to the middle one... and they connect to the analog inputs correctly We have measured voltages between red and white legs, and it shows inputs from 0 to 4.95V liniarically to the rotation i make... Here's our code: printf("%u",Get_Analog_Value(rc_ana_in01)); does not work with %d or %u.... could you show me the code of Get_Analog_value...perhaps the problem we have has to with that function... |
Re: HELP: analog input
I don't know this first hand, but does the analog port need to be setup as an input somewhere? Does the ADC need to be enabled?
ttyl, --buddy |
| All times are GMT -5. The time now is 17:52. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi