View Single Post
  #2   Spotlight this post!  
Unread 11-10-2006, 12:40
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Talking Re: EasyC-FRC - Arcade driving help

First you need to be in L2 or PRO mode. On the toolbar at the top of the window you should see L1, L2, and PRO. Select the one you need.

Create a new competition project.

Open the Operator control function.

Under the RC Control section of the commands you should see a "Arcade - 4 Motor". Add this to the Operator control function.

The options for this command are fairly simple.

EDIT: "Advanced" code i attached is fairly simple.
Code:
int LeftDrive, RightDrive;
unsigned char JoyY, JoyX;

JoyX = GetOIAinput(1,1);
JoyY = GetOIAinput(1,2);

LeftDrive = Limit(JoyX - JoyY + 127);
RightDrive = Limit(JoyX + JoyY -127);

// the mixing code above  produce values out of the 0-255 range.
// we must limit the values or we will get overloads and weird things.
LeftDrive = Limit(LeftDrive,0,255);
RightDrive = Limit(RightDrive,0,255);

//Assign motor values.
//Left motors
SetPWM(1, LeftDrive);
SetPWM(2, LeftDrive);

//Right motors
SetPWM(3, RightDrive);
SetPWM(4, RightDrive);
The limit function used above.
Code:
 
int Limit (int input, int min, int max)
{
  if (input < min)
  {
    input = min;
  }
  if (input > max)
  {
    input = max;
  }
  return input;
}
I have attached a program for you to look at.
If you need more help PM or e-mail me.

EDIT: I have attached another file with custom arcade software. It may be easier to use your "Magic calcs" with this.
Attached Files
File Type: zip Arcade Simple.zip (1.1 KB, 64 views)
File Type: zip Arcade Advanced.zip (1.8 KB, 87 views)
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 11-10-2006 at 13:27.