Log in

View Full Version : 4-Digit feedback from bot


Hershey
03-02-2005, 20:38
My team is going to try to use a potentiometer (or a sensor that will give a degree feedback) on our arm. The way that we wanted see the values we were getting was to use the 4-Digit LEDS that usually display the team number. We looked through the manual and all of the other forums, but we couldn't find anything. Any help would be greatly appreciated.

Alan Anderson
03-02-2005, 21:44
My team is going to try to use a potentiometer (or a sensor that will give a degree feedback) on our arm. The way that we wanted see the values we were getting was to use the 4-Digit LEDS that usually display the team number. We looked through the manual and all of the other forums, but we couldn't find anything. Any help would be greatly appreciated.
You can put an 8-bit value on the display. I don't have access to the code at the moment, so don't take any of this verbatim; look it up for yourself.

There's a global variable called User_Byte (or something like it) that your code can set. The part of the default code that controls the red and green feedback LEDs on the OI will copy its value to the numeric display when the OI display select button is used to select the user byte.

Mark McLeod
04-02-2005, 08:45
The way that we wanted see the values we were getting was to use the 4-Digit LEDS that usually display the team number.An example is provided in the FrcCode2005v2.2 version of the default code.
Look in user_routines.c at the very bottom and you will see the lines:

else /* User Mode is On - displays data in OI 4-digit display*/
{
User_Mode_byte = backup_voltage*10; /* so that decimal doesn't get truncated. */
}

This sets those OI digits to show the backup battery voltage (in tenths of volts). You can set User_Mode_byte equal to your pot, but you must shift the value 2 bits.
As Alan mentioned, you are limited to three of the display digits (a one byte 0-255 value).

To see this displayed on the OI, push the tiny select button on the OI until a "u" is displayed in the left most digit.