|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Jaguar problem?
We just have the jaguars hooked up to the cRIO board and we're having some trouble with the Jaguar. We hooked the Jaguar's output to a multimeter to test our circuits.
For some reason the code is not working. Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.t4069.robots;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import frc.t4069.utils.GameController;
import frc.t4069.utils.math.Point;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* 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 The2012Robot extends IterativeRobot {
Command autonomousCommand;
GameController gc = new GameController(new Joystick(1));
Jaguar j;
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
// instantiate the command used for the autonomous period
// autonomousCommand = new ExampleCommand();
// Initialize all subsystems
// CommandBase.init();
j = new Jaguar(2, 1);
}
public void autonomousInit() {
// schedule the autonomous command (example)
// autonomousCommand.start();
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
Scheduler.getInstance().run();
}
public void teleopInit() {
// This makes sure that the autonomous stops running when
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
// autonomousCommand.cancel();
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
Scheduler.getInstance().run();
Point rightStick = gc.getRightStick();
System.out.println(rightStick.y);
j.set(rightStick.y);
}
}
and our Jaguar is connected to PWM1 |
|
#2
|
|||||
|
|||||
|
Re: Jaguar problem?
Try removing the slot from your Jaguar object.
Code:
Jaguar j = new Jaguar(1); |
|
#3
|
||||
|
||||
|
Re: Jaguar problem?
If you have the old cRIO, any module in slots 4-3 is module 1, regardless of the slot and and module in slots 5-7 is module 2 regardless of the slot. Any module in slots 1-3 of the new cRIO is module 1 and the module in slot 4 is module 2 even though it's in slot 4. The code defaults to module 1 (slot 1, 2 or 3) unless you say otherwise. Thus, getting rid of the slot number in the code should work. It's confused a fair number of people here from what I can tell.
Last edited by cgmv123 : 17-01-2012 at 22:39. Reason: new crio |
|
#4
|
|||
|
|||
|
Re: Jaguar problem?
Quote:
No effect.. and I'm also on the new cRIO Also prehaps I should clarify that the multimeter doesn't show anything other than 0. |
|
#5
|
||||
|
||||
|
Re: Jaguar problem?
We're having the same problem. There is already some discussion about the same issue in this thread.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|