|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
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
|
|||||
|
|||||
|
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.
|
|
#3
|
|||
|
|||
|
Re: Analog Inputs
Quote:
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
|
|||||
|
|||||
|
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.
|
|
#5
|
|||||
|
|||||
|
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
|
|||
|
|||
|
Re: Analog Inputs
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |