View unanswered posts | View active topics It is currently Wed Dec 07, 2016 8:17 pm






Reply to topic  [ 2 posts ] 
Help! 
Author Message
Rookie

Joined: Wed Jun 22, 2016 12:27 pm
Posts: 1
Post 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;
}
}

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


Thu Jun 23, 2016 5:08 pm
Profile
Expert

Joined: Thu Dec 01, 2011 12:07 am
Posts: 146
Post 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.


Fri Jun 24, 2016 11:31 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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:  



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