View unanswered posts | View active topics It is currently Thu Oct 30, 2014 8:16 am






Reply to topic  [ 2 posts ] 
how to make a arm move up and down with 2 motors 
Author Message
Rookie

Joined: Wed Dec 21, 2011 4:22 pm
Posts: 26
Post how to make a arm move up and down with 2 motors
This is the code that i made but i dont know if it works and i cant test it out because i dont have a robot.

task main()
{
while (true)
{
if (vexRT[Btn6U]) //i am using the channel 6 button U to lift the arm up
{
motor [armmotor left] = 40; //this motor will be reflected in motor and sensors set up
motor [armmotor right] = 40;
}
else if (vexRT[Btn6D]) // i am using channel 6 button D to bring the arm down
{
armmotor right Reflected // i am not sure if this code "armmotorright Reflected" will work
motor [armmotor left] = 40;
motor [armmotor right] = 40;
}
else
{
motor [armmotor left] = 0;
motor [armmotor right] = 0;
}
}
}


Thu Dec 22, 2011 5:56 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: how to make a arm move up and down with 2 motors
Yes, this looks like it will work. I don't know bout how your motors are arranged, so you may have to put a negative sign on one of the numbers, or reflect the correct motor. Speaking of which, the way you reflect the motor is by typing "bMotorReflected[armmotorleft]". This should usually not be done in the while loop. Instead, put it at the top of your program after task main(). If you need to change the direction of motion, put a negative sign in front of the value.

_________________
sudo rm -rf /


Thu Dec 22, 2011 6:27 pm
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.