View Single Post
  #3   Spotlight this post!  
Unread 25-02-2003, 05:47
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
As stated, you cannot control the OI from your joystick, but you can control what your User Mode displays. Just leave the OI in user_mode, and use "selection buttons" on your console.

vbutton, &c, are aliases for console buttons (OI_swAb.bit#), temp is a scratch pad, byte-size variable. The way this is arranged, if two people want to see different things (volts & direction, say) the first branch gets priority, so they will see voltage in the user window.

program snippet....

if vbutton then show_volts
if dbutton then show_direction

show_amps:
temp = sensor3
goto show_it

show_volts:
temp = battery_volts (=sensor8) * bewitch_factor
goto show_it

show_direction:
temp = gyro_heading.highbyte

show_it:
out8 = temp.bit0
out9 = temp.bit1
out10 = temp.bit2
out11 = temp.bit3
out12 = temp.bit4
out13 = temp.bit5
out14 = temp.bit6
out15 = temp.bit7

...rest of program

Last edited by Lloyd Burns : 25-02-2003 at 05:55.