View unanswered posts | View active topics It is currently Mon Sep 15, 2014 9:11 pm






Reply to topic  [ 3 posts ] 
4 Motor Arcade Driving Control 
Author Message
Rookie

Joined: Sun Sep 20, 2009 6:00 pm
Posts: 1
Post 4 Motor Arcade Driving Control
I have been trying to get four motor drive on one stick for a few weeks now. I took the sample code for two motors and tryed to adapt that for four. So far my code looks like this.
Code:
task main()
{
   bMotorFlippedMode[port2] = 1;    
   bMotorFlippedMode[port4] = 1;
   bVexAutonomousMode = false;         

   while (true)   
   {
      motor[port1] = vexRT[Ch4] - vexRT[Ch3];
      motor[port3] = vexRT[Ch3] + vexRT[Ch4];
      motor[port2] = vexRT[Ch3] + vexRT[Ch4];
      motor[port4] = vexRT[Ch4] - vexRT[Ch3];
    motor[port5] = vexRT[Ch5];
  }
}


I need motor 2 and 4 going the opposite way, as they are only one gear over from the wheels. Right now as my code is set, If I push the left stick forward, it will go forward. Back goes back, but left goes right and right goes left. Is there anyway to get this working?


Sun Sep 20, 2009 6:14 pm
Profile
Rookie

Joined: Sat Aug 30, 2008 2:25 am
Posts: 25
Post Re: 4 Motor Arcade Driving Control
This is what I use:

Code:
#pragma config(Motor,  port1,           LeftMotor1,           tmotorNormal)
#pragma config(Motor,  port2,           RightMotor1,          tmotorNormal)
#pragma config(Motor,  port7,           LeftMotor2,           tmotorNormal)
#pragma config(Motor,  port8,           RightMotor2,          tmotorNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//


task main()
{
  bMotorFlippedMode[LeftMotor1] = 1;
  bMotorFlippedMode[LeftMotor2] = 1;
  bVexAutonomousMode = false;
  while (true) {
    motor[LeftMotor1]  = vexRT[Ch3] + vexRT[Ch4];
    motor[RightMotor1] = vexRT[Ch3] - vexRT[Ch4];
    motor[LeftMotor2]  = vexRT[Ch3] + vexRT[Ch4];
    motor[RightMotor2] = vexRT[Ch3] - vexRT[Ch4];
    wait1Msec(10);
  }
}


But it sounds like you just need to flip the direction on the correct motors. I'd just experiment, making sure one of the paired motors is unplugged so that they don't fight each other (assuming they are directly connected). Also, I noticed that I always do Ch3 (+ or -) Ch4 where as you swap the two sometimes.


Sun Oct 25, 2009 3:16 pm
Profile
Rookie

Joined: Thu Aug 15, 2013 9:11 pm
Posts: 1
Post Re: 4 Motor Arcade Driving Control
I'm new to robot c and I'd like to convert my 4-wheel arcade drive to robot c. How can I do that? All 4 wheels go the same direction. (If looked everywhere for a tutorial without luck)


Thu Aug 15, 2013 9:18 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.