![]() |
coding a potentiometer
I am trying to look at the values i get with a potentiometer through the dashboard, but my attempts are ending in failure. :(
So is there some special code that have to put in so that i can read it or is it because i have it plugged in the wrong spot. anyone know the solution? :confused: |
Re: coding a potentiometer
Quote:
once you do that use this code: (assuming you connected it to analog input #1) Code:
pot1=Get_Analog_Value(rc_ana_in01);-Leav |
Re: coding a potentiometer
Do you have to pot attached to the OI or attached to the RC?
You could have a wiring problem with the pot in either place, so double check the OI or RC specs for correct wiring. The dashboard display for the OI comes setup to show the joystick port pot values as a range from 0-254. For the RC dashboard screen you'll have to scale the pot (0-1023) to the range (0-255) and set one of the User_Byte's (1-6) to that value. |
Re: coding a potentiometer
Quote:
Code:
User_Byte1 = value >> 8; |
Re: coding a potentiometer
Just bitshift it twice (from a 10 bit to an 8 bit number)
Code:
POT = Get_Analog_Value(rc_ana_in01) >> 2; |
thanks, that situation has been taken care off. appreciate greatly.
:) |
| All times are GMT -5. The time now is 23:56. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi