Go to Post My own opinion is that any truly great student can succeed with any teacher, and any truly great teacher can succeed with any group of students. - DampRobot [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 13-01-2012, 09:18
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Coding for CIM Motor help

Typically teams use tank drive but it is really personal choice, i belive you could simplify your code a bit to by using:

Your Mainclass:

Code:
RobotDrive drive;
Joystick left, right;
robotInit:
Code:
drive = new RobotDrive(1,2,3,4); // Four motors on pwm You can replace with CANJaguars too.
right = new Joystick(1);
left = new Joystick(2);
operatorControl:
Code:
drive.tankDrive(left.getY(), right.getY());
For arcade:
Code:
drive.arcadeDrive(left.getY(), left.getX()); // your Y val is your speed and the X value is your turning
You may have to import classes if so just right click the underlined errors and click fix imports

Last edited by ProgrammerMatt : 13-01-2012 at 09:21.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:00.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi