ROBOTC.net forums
http://www.robotc.net/forums/

VEX LCD Buttons
http://www.robotc.net/forums/viewtopic.php?f=53&t=3452
Page 1 of 1

Author:  cloud202 [ Wed Sep 07, 2011 4:22 pm ]
Post subject:  VEX LCD Buttons

What is the code for the lcd buttons with ROBOTC 3.0?

Author:  bfeher [ Fri Sep 09, 2011 10:30 am ]
Post subject:  Re: VEX LCD Buttons

Hi cloud202,

It's very simple, just use this code:

Code:
if(nLCDButtons == button)
{
  // do something
}

"button" is where you would put an integer that corresponds to the buttons on the VEX LCD. The buttons are:
Left = 1
Center = 2
Right = 4.

Knowing this, you can then check for combinations of buttons being pressed by summing their value. So if you wrote,
Code:
if(nLCDButtons == 6)
{
  // do something
}

you would be checking to see if BOTH the CENTER and RIGHT buttons were pressed, since 2+4 = 6.

So the full table of buttons would be:

LEFT = 1
CENTER = 2
left&center = 3
RIGHT = 4
left&right = 5
center&right = 6
ALL = 7


Hope that helps!

Author:  cloud202 [ Fri Sep 09, 2011 3:45 pm ]
Post subject:  Re: VEX LCD Buttons

Thank you. That helps alot.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/