Go to Post Engineering is NOT manufacturing. .... It is good to be able to fabricate things with your own hands, but thats not what engineers do. - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming
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
  #1   Spotlight this post!  
Unread 20-01-2014, 17:02
Wzup4021 Wzup4021 is offline
Registered User
FRC #4021 (igKnightion)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: United States
Posts: 32
Wzup4021 is an unknown quantity at this point
Can't get motors to spin correct way.

We have successfully gotten our robot wheels (6 wheel tank drive, 2 motors on each side) to spin, however they are going the wrong way. We have tried inserting a negative in many places in our code, we have tried multiplying by -1 and nothing seems to work. With everything we tried, the wheels will still spin the wrong way (they will spin either way, but the joystick/spin is reversed). Here is that part of the code:

public void operatorControl() {
chassis.setSafetyEnabled(true);
while (isOperatorControl() && isEnabled()) {
Joystick1 = leftStick.getAxis(Joystick.AxisType.kY);
Joystick2 = rightStick.getAxis(Joystick.AxisType.kY);

Originally we had this, but changed it to the above:
Joystick1 = leftStick.getY();
Joystick2 = rightStick.getY();


//Left Side Motor Code, controlled by the left joystick(might need to switch direction)
if ((Joystick1 < 0.1)&&(Joystick1 > -0.1)) {
LeftMotors.set(0);
}

else {
LeftMotors.set (Joystick1);
}

//Right Side Motor Code, controlled by the right joystick(might need to switch direction)
if ((Joystick2 < 0.1)&&(Joystick2 > -0.1)) {
RightMotors.set(0);
}

else {
RightMotors.set(Joystick2);
}


}
}
 


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:04.

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