Go to Post Desperation is the mother of accomplishment. - Koko Ed [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
  #6   Spotlight this post!  
Unread 20-12-2013, 13:17
BlackUnicorns BlackUnicorns is offline
Registered User
FRC #5135
 
Join Date: Dec 2013
Location: Israel
Posts: 3
BlackUnicorns is an unknown quantity at this point
Re: Just began using Java

Quote:
Originally Posted by Jon Stratis View Post
Change this line:

RobotDrive myDrive = new RobotDrive(1, 2);

to:

RobotDrive myDrive = new RobotDrive(2, 1);


Think about what's happening. When you push forwards on the joystick, the RobotDrive tells both motors (1 and 2) to drive forward, which works fine. Likewise, pulling the joystick backwards makes both motors go backwards.

But if you want to turn left (spin in place) then one motor has to go forwards and one has to go backwards. In this case, it picked the wrong ones, and as a result spins in the wrong direction. By switching the order you pass in the motors, you'll switch it's choice and it'll turn in the right direction.
What you say makes a lot of sense, but i remember that we tried doing it today and it didnt work..
I dont have the robot now to try it but i will try it tomorrow and see if it works.

by the way, i remember when we used labview, it had a robot simulator, does java has something like that too?
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 12:16.

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