View Single Post
  #3   Spotlight this post!  
Unread 14-02-2009, 13:07
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Re: Using Integer variables

yes, where to put the variable seems to be our problem. we want to use the variable to keep track of the state of one of our joystick buttons in teleop mode.

int x;
//Now later in the program during teleop routines
if (rightStick->GetRawButton(2)) {
if x = 1 {
x=0; }

else {
x=1; }

x could then be examined to determine the speed of our motors.
__________________
"I would love to change the world but no one will give me the source code"