View unanswered posts | View active topics It is currently Sun Apr 20, 2014 1:52 am






Reply to topic  [ 3 posts ] 
VEX LCD Buttons 
Author Message
Rookie

Joined: Wed Sep 07, 2011 4:20 pm
Posts: 5
Post VEX LCD Buttons
What is the code for the lcd buttons with ROBOTC 3.0?


Wed Sep 07, 2011 4:22 pm
Profile
Site Admin
Site Admin

Joined: Mon Jun 08, 2009 4:50 pm
Posts: 70
Post 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!

_________________
Bence Feher

Undergraduate Intern - NREC, Robotics Academy
ROBOTC - Testing/Documentation/Developer

Computer Science, Japanese, East Asian Studies
University of Pittsburgh, Konan University 甲南大学


Fri Sep 09, 2011 10:30 am
Profile
Rookie

Joined: Wed Sep 07, 2011 4:20 pm
Posts: 5
Post Re: VEX LCD Buttons
Thank you. That helps alot.


Fri Sep 09, 2011 3:45 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.