|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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... |
|
#2
|
|||||
|
|||||
|
Re: HELP: analog input
If your idea of "good" does not match what the RC expects, it won't work no matter how many times you check to see that it's "good". In order to help you, we need to know exactly how you have wired it. Answering "we wired it correctly" is not going to help. For example:
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. |
|
#3
|
|||||
|
|||||
|
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... Last edited by Tottanka : 15-02-2007 at 11:52. |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
Re: HELP: analog input
Make sure you are calling the function
Code:
Set_Number_of_Analog_Channels(SIXTEEN_ANALOG); /* DO NOT CHANGE! */ Good luck. |
|
#6
|
|||||
|
|||||
|
Re: HELP: analog input
Okay, here is code from our robot this year. This is exactly how we have written it and it works.
We made variables on top of the file: Code:
unsigned int BottomSonic = 0; Code:
Getdata(&rxdata);
TopSonic = Get_Analog_Value(rc_ana_in02);
printf("Top: %d\r\n", TopSonic);
Putdata(&txdata);
Also, try it on a fresh piece of code with the absolute default code from IFI. |
|
#7
|
|||||
|
|||||
|
Re: HELP: analog input
Make sure your init functions are correct.
and call the get_analog_value() |
|
#8
|
|||||
|
|||||
|
Re: HELP: analog input
You left out important details here. Please replace the word "correctly" with a description of the actual connection to the Robot Controller.
|
|
#9
|
||||
|
||||
|
Re: HELP: analog input
I have been having the exact same issue. I tried IFI's ADC, Kevin Watson's integrated into my code, Kevin Watson's from his website(unmodified), and whatever EasyC uses.
They all read 0. I have tried both the 2006 and 2007 controllers. I have the pot connected so the 5v+/gnd each connect to one side of the pot, and the signal is connected to the middle connector on the pot. If I short the gnd/sig pins the reading does NOT change. I have used Kevin Watson's ADC without any issues before now. I have run it on VEX, EDU, and 2005 controllers. I was at the Sussex mini-regional today and talked to 4-5 other programmers, and none of them had any ideas. What am I missing? Thanks, Eric Haskins |
![]() |
| 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 |