Go to Post As a programmer, I am trying to use more 0's than 1's to save weight. - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 15-02-2007, 13:15
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
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.
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
  #17   Spotlight this post!  
Unread 15-02-2007, 13:23
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
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.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #18   Spotlight this post!  
Unread 15-02-2007, 13:38
FIRST JerseyKid's Avatar
FIRST JerseyKid FIRST JerseyKid is offline
Alumni
AKA: Erik Cokeley
FRC #0025 (Team Mercury)
Team Role: Alumni
 
Join Date: Oct 2002
Rookie Year: 1996
Location: Hightstown New Jersey
Posts: 52
FIRST JerseyKid is on a distinguished road
Send a message via AIM to FIRST JerseyKid Send a message via Yahoo to FIRST JerseyKid
Re: HELP: analog input

Make sure your init functions are correct.

and call the get_analog_value()
__________________
Team 1089 alumni coach.
  #19   Spotlight this post!  
Unread 15-02-2007, 14:57
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: HELP: analog input

Quote:
Originally Posted by Tottanka View Post
...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.
  #20   Spotlight this post!  
Unread 18-02-2007, 19:27
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
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
__________________
Eric Haskins KC9JVH
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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