Go to Post Note: Please don't actually mob them or cause them any harm. It's just a saying people. :) - CalTran [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
  #1   Spotlight this post!  
Unread 13-03-2006, 12:35
bush's Avatar
bush bush is offline
Registered User
AKA: Aaron
FRC #0710 (Pine Crest School)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Fort Lauderdale, Florida
Posts: 42
bush has a spectacular aura aboutbush has a spectacular aura about
Send a message via AIM to bush
Analog Inputs

If we had an analog input device hooked up to Analog Input Port 1, what would the value rc_ana_in01 represent? Is it the voltage? Or possibly (Voltage * 1024 / 5)?
  #2   Spotlight this post!  
Unread 13-03-2006, 12:36
DjAlamose's Avatar
DjAlamose DjAlamose is offline
Registered User
AKA: Teh Albie
FRC #0279 (Tech Fusion)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2003
Location: Toledo, OH
Posts: 343
DjAlamose is a splendid one to beholdDjAlamose is a splendid one to beholdDjAlamose is a splendid one to beholdDjAlamose is a splendid one to beholdDjAlamose is a splendid one to beholdDjAlamose is a splendid one to beholdDjAlamose is a splendid one to beholdDjAlamose is a splendid one to behold
Send a message via AIM to DjAlamose
Re: Analog Inputs

Resistance is usally the value it looks at. I have minimal FIRST electircal experiance but normally this is whats looked at with analog.
__________________
WHAT TIME IS IT????? 279!!


2006 GLR Safety Award (2nd year in a row)
2005 National Xerox Creativity Award
2005 National Curie Quarter Finalist w/ 1126 and 180
2005 Buckeye Regional Champs w/ 67 and 274
2005 Buckeye Regional GM Industrial Design Award
2005 Buckeye Regional Safety Award
2005 GLR Quarter Finalist
2005 GLR Xerox Creativity Award
2005 GLR Safety Award
2004 Nationals Curie Division Finalist
2004 GLR Champs
2004 Buckeye Delphi Driving Tomorrow Award
2004 Buckeye Quarter Finalist w/ 1001 and 869
2003 GM Industrial Design Award GLR
2001 National Champs
  #3   Spotlight this post!  
Unread 13-03-2006, 12:42
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: Analog Inputs

Quote:
Originally Posted by bush
If we had an analog input device hooked up to Analog Input Port 1, what would the value rc_ana_in01 represent? Is it the voltage? Or possibly (Voltage * 1024 / 5)?
rc_ana_in01 is a constant that you pass to GetAnalogValue in order
to read the corresponding analog input.

For example:
int analogvaluefrominput01;
analogvaluefrominput01 = GetAnalogValue(rc_ana_in01);

The resulting value stored in the int variable has the range 0 to 1023
0 corresponds to roughly zero volts, and 1023 corresponds to roughly
5 volts. Your equation reflects that.

Edit: The analog inputs on the RC look at voltage. When a POT is
hooked up to one these inputs it is wired as a voltage divider for a
5 volt supply. The analog inputs on the OI have a different range,
0 to 255(254), and are set up to jump to 127 in the event that 0 volts is
applied (or the circuit opens), for safety reasons.

Eugene

Last edited by eugenebrooks : 13-03-2006 at 12:46.
  #4   Spotlight this post!  
Unread 13-03-2006, 12:58
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Analog Inputs

There is an upper and lower threshold to these voltages. I don't remember exactly where they are but it is significantly different than 0 and 5V. Over the Upper Threshold you will get 1023. I think you get 0 below the Lower Threshold. Make sure you center any pots you are using so that the entire Range of Motion is in the significant voltage range.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #5   Spotlight this post!  
Unread 13-03-2006, 13:08
bush's Avatar
bush bush is offline
Registered User
AKA: Aaron
FRC #0710 (Pine Crest School)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Fort Lauderdale, Florida
Posts: 42
bush has a spectacular aura aboutbush has a spectacular aura about
Send a message via AIM to bush
Re: Analog Inputs

ahh thanks I understand now

So for example...
The dual-axis accelerometer supplied in the kit has a sensitivity of 290mV per g (acceleration due to gravity) and a range of +/- 2g. So the accelerometer reports voltages in the range of 1.92 - 3.08, and Get_Analog_Value(rc_ana_in01) would return values in the range from 393 - 631. Then I can convert that number into units of g with...

Code:
(Get_Analog_Value(rc_ana_in01) - 512) * 5.0 / 1024 / 0.290
??
  #6   Spotlight this post!  
Unread 13-03-2006, 17:49
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
Re: Analog Inputs

Quote:
Originally Posted by 2005 Full-Size Robot Controller Reference Guide
Any sensor which outputs a variable 0-5V signal may be read with 10-bit resolution on these inputs.
The correct function spelling is Get_Analog_Value() and it is defined in ifi_utilities.c
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
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
Dashboard with analog and dig inputs Andrew Schreiber National Instruments LabVIEW and Data Acquisition 1 13-02-2006 22:48
How do the Analog Inputs work? JBotAlan Electrical 3 07-01-2005 00:11
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Failing analog inputs? Phasmatis568 Control System 5 22-01-2004 13:28
Serious Controller Ideas archiver 1999 28 23-06-2002 23:01


All times are GMT -5. The time now is 21:56.

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