Go to Post When I invite a woman to dinner, I expect her to look at my face. That's the price she has to pay. - dlavery [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
  #1   Spotlight this post!  
Unread 25-10-2014, 21:15
Team2634's Avatar
Team2634 Team2634 is offline
Robotics Member
AKA: Martin Garcia
FRC #2634 (Gryphons)
Team Role: Electrical
 
Join Date: Oct 2014
Rookie Year: 2010
Location: Canada
Posts: 1
Team2634 is an unknown quantity at this point
Can you please check our code? - FRC Java

I am the new programming lead in my team and well i did not learn much last year about programming so I kinda expected this to happen. When I put this code into the robot only BRDrive motor moves and very slowly. This happens when i turn on autonomous or telop. That motor is the only one on and i do not even touch any of the controls even in telop. I have no idea why this is happening. If you do not think that it is the programming please tell me hat you think it could be whether it be electrically or something when inputing the code into the robot or whatever.
Code:

import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;

/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the SimpleRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class RobotTemplate extends SimpleRobot {

public Joystick joyStick = new Joystick(1);
public RobotDrive tankDrive = new RobotDrive(1,2,3,4);
public Jaguar FLDrive = new Jaguar(1);
public Jaguar FRDrive = new Jaguar(2);
public Jaguar BLDrive = new Jaguar(3);
public Victor BRDrive = new Victor(4);
public Victor PickerFront = new Victor(5);
public Victor PickerRear = new Victor(6);
/**
* This function is called once each time the robot enters autonomous mode.
*/
public void autonomous() {
PickerFront.set(1.0);
PickerRear.set(1.0);
FLDrive.set(1.0);
FRDrive.set(1.0);
BLDrive.set(1.0);
BRDrive.set(1.0);
}

/**
* This function is called once each time the robot enters operator control.
*/
public void checkUserInputs() {

tankDrive.tankDrive((-joyStick.getY()), (-joyStick.getRawAxis(5)));

if (joyStick.getRawButton(1) == true) {
PickerFront.set(1.0);
} else if (joyStick.getRawButton(4) == true) {
PickerFront.set(-1.0);
} else if (joyStick.getRawButton(1) == true & joyStick.getRawButton(4) == true) {
PickerFront.set(0.0);
} else {
PickerFront.set(0.0);
}


if (joyStick.getRawButton(3) == true) {
PickerRear.set(1.0);
} else if (joyStick.getRawButton(2) == true) {
PickerRear.set(-1.0);
} else if (joyStick.getRawButton(3) == true & joyStick.getRawButton(2) == true) {
PickerRear.set(0.0);
} else {
PickerRear.set(0.0);
}

}

/**
* This function is called once each time the robot enters test mode.
*/
}

Last edited by Team2634 : 25-10-2014 at 22:56.
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:11.

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