|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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? |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||||
|
|||||
|
Re: HELP: analog input
printf("Pot %d\r", Get_ADC_Result(1));
|
|
#4
|
|||
|
|||
|
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). |
|
#5
|
|||||
|
|||||
|
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. |
|
#6
|
|||||
|
|||||
|
Re: HELP: analog input
Quote:
Potentiometervalue = Get_Analog_Value(rc_ana_in01); |
|
#7
|
||||
|
||||
|
Re: HELP: analog input
Quote:
-Kevin |
|
#8
|
|||||
|
|||||
|
Re: HELP: analog input
We have tried both things, with Kevin's code and it still did not work...
any further suggestions? |
|
#9
|
|||
|
|||
|
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?).
|
|
#10
|
|||||
|
|||||
|
Re: HELP: analog input
We tested it with a voltmeter and it all good....
|
|
#11
|
|||||
|
|||||
|
Re: HELP: analog input
But is it wired up correctly? You can test it at a point on the potentiometer and get correct readings. However, if it is not wired up correctly, the processor will not be able to read it. There is also a slight chance the processor itself has corrupted analog pins. That happen to our 2006 controller at the end of the season.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FRC analog input RC filter values | Gdeaver | Control System | 2 | 01-01-2006 22:03 |
| Analog and digital input question | Robby | Control System | 7 | 30-04-2005 20:07 |
| Analog Input Trouble | Matt Krass | Programming | 10 | 20-01-2005 21:09 |
| Resistance to Analog Input Value. | Josh Hambright | Electrical | 12 | 15-04-2003 16:12 |
| DC Motor current to an Analog Input | junkyarddawg | Motors | 43 | 04-04-2002 15:53 |