![]() |
RC Analog
Need help. Does anyone know how to call the RC analogs. Is it the same as digitals. We are using IR sensors and want to use the RC analog ports. The digital call is rc_dig_in01. What is the call for analog? Thanks.
|
Re: RC Analog
look in ifi_aliases.h for the one you want to use. Then use the "Get_Analog_Value" function to retrieve the value.
|
Re: RC Analog
The call for analogs are
rc_ana_inXX be careful though, you can't directly read these, you need to run them through the Analog to Digital Converter. If your using the default code it would be called like this Code:
Get_Analog_Value(rc_ana_in01); |
Re: RC Analog
Thanks. I'm using the new code from Kevin. When I put
Get_Analog_Value(rc_ana_in01); in my code I get errors. Can you show me a small loop to achieve this. Thanks again. |
Re: RC Analog
Quote:
|
Re: RC Analog
It's also important to note that Get_ADC_Result uses just the number (1, 2, 3 etc...) not rc_ana_inXX
So instead of Code:
Get_Analog_Value(rc_ana_in01);Code:
Get_ADC_Result(1); |
Re: RC Analog
Tried the Get_ADC_Result(1); and it does not compile. Went to the old code and used Get_Analog_Value(rc_ana_in01); and it does compile. I'm using the printf to see my value: example: printf ("Analog 1 = %i \r\n"' rc_ana_in01); and I'm not getting any readings from my IR sensors. I fell very confident the sensors are working correctly and I have it plugged to the Analog one port on the RC. What am I doing wrong??? How can I get the analog reading? Thanks for all of the help so far and I feel close to solving this problem.
|
Re: RC Analog
We use the following lines to read an ultrasonic sensor...
uProximityRaw = Get_ADC_Result(RHS_PROXIMITY_LEFT); uProximityMv = Convert_ADC_to_mV(uProximityRaw); ... and it absolutely works. So you must not have Kevin's ADC stuff set up correctly. If this does not compile, make sure that adc.c is in your project, follow the directions in adc.h for configuration and make sure to put the following line in all source files where you call Get_ADC_Result(x). #include "adc.h" HTH |
Re: RC Analog
That was it.. Thanks to all. You guys are "THE MAN"...
|
| All times are GMT -5. The time now is 01:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi