Thread: OI LEDs
View Single Post
  #2   Spotlight this post!  
Unread 12-02-2008, 17:25
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: OI LEDs

From IFI docs on the software/OI

Quote:
User Mode
Bit 5 of rc_mode_byte (aliased as user_display_mode) indicates when the user selects the
"User Mode" on the OI. In "User Mode", user_display_mode is set to 1. When the user selects
channel, team number, or voltage, user_display_mode is set to 0. When in "User Mode", Robot
Feedback LEDs are turned off and the value stored in txdata.LED_byte1.data is displayed on the
multi-segment display on the Operator Interface. By default this is set to the value of the backup
battery. "User Mode" is identified by the letter “u” in the left digit of the display on the Operator
Interface.
So make sure the OI display is not showing "u000" in the OI-4 digit display. This is changed with the "Select" button on the OI.

Also, the LED byte in the txdata packet is shared:

Code:
#define User_Mode_byte  txdata.LED_byte1.data

#define Pwm1_green      txdata.LED_byte1.bitselect.bit0
#define Pwm1_red        txdata.LED_byte1.bitselect.bit1 
#define Pwm2_green      txdata.LED_byte1.bitselect.bit2
#define Pwm2_red        txdata.LED_byte1.bitselect.bit3 
#define Relay1_red      txdata.LED_byte1.bitselect.bit4 
#define Relay1_green    txdata.LED_byte1.bitselect.bit5
#define Relay2_red      txdata.LED_byte1.bitselect.bit6 
#define Relay2_green    txdata.LED_byte1.bitselect.bit7
Make sure no one is clearing or setting User_Mode_byte after you setup the LEDs.