Go to Post Some of them look like phone numbers... LETS START CALLING THEM ALL! - akoscielski3 [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-01-2012, 23:20
korsuk19's Avatar
korsuk19 korsuk19 is offline
Registered User
FRC #3734 (Caxy's)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Lake Forest, Illinois
Posts: 14
korsuk19 is an unknown quantity at this point
Coding for CIM Motor help

Hello, I am the new programmer for my team, but I'm not all that great yet.
Right now I have to code to make our CIM motor's drive. I have to make it so that the left motors are controlled by the left joystick and right motors to be controlled by the right joy stick. This is my question.

I've been coding for tank drive, but would arcade be easier?

This is the code I have.
Attached Files
File Type: java test.java (594 Bytes, 26 views)
__________________
just wanna learn
Reply With Quote
  #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
  #3   Spotlight this post!  
Unread 13-01-2012, 10:28
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: Coding for CIM Motor help

Quote:
Originally Posted by ProgrammerMatt View Post
You may have to import classes if so just right click the underlined errors and click fix imports
If you're using NetBeans, there is a shortcut (default Ctrl+Shift+I) which automatically fixes imports. VERY handy.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Reply With Quote
  #4   Spotlight this post!  
Unread 13-01-2012, 14:34
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

Quote:
Originally Posted by Patrickwhite View Post
If you're using NetBeans, there is a shortcut (default Ctrl+Shift+I) which automatically fixes imports. VERY handy.
Yes true and i <3 netbeans
Reply With Quote
Reply


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 22:21.

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