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?
on your pot you should have 3 pins, i blieve that the two outer ones should be connected to the + and - pins of the analog inputs and the middle one to the signal pin. (not infront of the robot right now…)
once you do that use this code: (assuming you connected it to analog input #1)
pot1=Get_Analog_Value(rc_ana_in01);
printf("pot1=%d \r ",pot1);
i’m not sure if you can read the analog inputs with the dashboard…
-Leav
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.
Or use two user bytes:
User_Byte1 = value >> 8;
User_Byte2 = value & 255;
Just bitshift it twice (from a 10 bit to an 8 bit number)
POT = Get_Analog_Value(rc_ana_in01) >> 2;
thanks, that situation has been taken care off. appreciate greatly.