View unanswered posts | View active topics It is currently Mon Dec 17, 2018 5:53 am






Reply to topic  [ 2 posts ] 
Programming the arm 
Author Message
Rookie

Joined: Thu Sep 10, 2015 3:19 pm
Posts: 1
Post Programming the arm
I am not sure what I'm doing wrong, but I cannot get the arm to work with the joystick although the left and right motors work just fine. Thanks for your help.

Below is my code:

#pragma config(Motor, port1, rightMotor, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port6, armMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, leftMotor, tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main ()
{

while(1 == 1)
{
motor[leftMotor] = vexRT[Ch3]; // Left Joystick Y value
motor[rightMotor] = vexRT[Ch2]; // Right Joystick Y value
}

if (vexRT[Btn6U] ==1)
{
motor[armMotor] = 40;
}

else
{
motor[armMotor] = 0;
}

if (vexRT[Btn6D] == 1)
{
motor[armMotor] = -40;
}

else
{
motor[armMotor] = 0;
}

}


Thu Sep 10, 2015 4:20 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post Re: Programming the arm
Take a look at your while loop; what specifically determines which code is executed by the loop, and what code is currently being controlled by the loop? Also, how long is that loop going to keep executing code for? The answers to these questions should help point you in the correct direction.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.


Fri Sep 11, 2015 9:07 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.