Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   HELP: analog input (http://www.chiefdelphi.com/forums/showthread.php?t=54146)

Shinigami2057 15-02-2007 13:15

Re: HELP: analog input
 
Make sure you are calling the function

Code:

    Set_Number_of_Analog_Channels(SIXTEEN_ANALOG); /* DO NOT CHANGE! */
In User_Initialization(). Otherwise, I really don't know what to tell you. Make sure it's connected to the RC properly (wire ordering), there are no breaks in the PWM cable, that the wires are SECURELY (i.e. soldered) connected to the pot, and that you've tried it with all the analog inputs (well, 2-4 of them should probably suffice).

Good luck.

Bharat Nain 15-02-2007 13:23

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;
Then, inbetween Getdata and Putdata, we inserted these two lines:
Code:


Getdata(&rxdata);


TopSonic = Get_Analog_Value(rc_ana_in02);

printf("Top: %d\r\n", TopSonic);


Putdata(&txdata);

If you have it wired up correctly, then the code above will work.


Also, try it on a fresh piece of code with the absolute default code from IFI.

FIRST JerseyKid 15-02-2007 13:38

Re: HELP: analog input
 
Make sure your init functions are correct.

and call the get_analog_value()

Alan Anderson 15-02-2007 14:57

Re: HELP: analog input
 
Quote:

Originally Posted by Tottanka (Post 578746)
...and they connect to the analog inputs correctly...

You left out important details here. Please replace the word "correctly" with a description of the actual connection to the Robot Controller.

EHaskins 18-02-2007 19:27

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


All times are GMT -5. The time now is 03:11.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi