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

Help!
http://robotc.net/forums/viewtopic.php?f=11&t=19047
Page 1 of 1

Author:  jvexler [ Thu Jun 23, 2016 5:08 pm ]
Post subject:  Help!

I am trying to use buttons on my joystick to make turns instead of the toggle sticks. I have written the following program but the only button that will work is the one on the top of the code. Clueless how to solve this? Ideas?
task main ()
{
while (1==1)
if (vexRT[Btn8L]== 1)
{

motor[rightMotor]=33;
}
else
{
motor[rightMotor]=0;
}

if (vexRT[Btn8R]== 1)
{

motor[leftMotor]=33;
}
else
{
motor[leftMotor]=0;
}

if (vexRT[Btn8U]== 1)
{

motor[rightMotor]=33;
motor[leftMotor]=33;
}
else
{
motor[rightMotor]=0;
motor[leftMotor]=0;
}

if (vexRT[Btn8D]== 1)
{

motor[rightMotor]=-33;
motor[leftMotor]=-33;
}
else
{
motor[rightMotor]=0;
motor[leftMotor]=0;
}
}

//++++++++++++++++++++++

Author:  CARBOT [ Fri Jun 24, 2016 11:31 am ]
Post subject:  Re: Help!

If you put the lines after the while loop in braces {} it will execute them repeatedly. Without the braces it just does one line.

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