|
Page 1 of 1
|
[ 2 posts ] |
|
Author |
Message |
jvexler
Rookie
Joined: Wed Jun 22, 2016 12:27 pm Posts: 1
|
 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 |
|
 |
CARBOT
Expert
Joined: Thu Dec 01, 2011 12:07 am Posts: 151
|
 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 |
|
|
|
Page 1 of 1
|
[ 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
|
|