View Single Post
  #1   Spotlight this post!  
Unread 12-05-2015, 18:24
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 370
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Joysticks not reading

I am reprogramming our 2014 robot, and the joysticks will not read in the code. However, the DS USB port tab does read the values properly. I have also tried multiple different controllers to no avail. This is using the pre-2015 control system.

Robot.java
Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;

public class Robot extends IterativeRobot {
    
    Joystick driveStick;
    
    public void robotInit() {
        Storage.createObjects();
        driveStick = new Joystick(1);
    }

    public void autonomousPeriodic() {

    }

    public void teleopInit() {
        
    }
    
    public void teleopPeriodic() {
        System.out.println(driveStick.getRawAxis(4));
    }
    
    public void testPeriodic() {
    
    }
    
}
Storage.java
Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Talon;

public class Storage {
    
    public static Talon leftTalon1, leftTalon2, rightTalon1, rightTalon2;
    
    public static RobotDrive drive;
    
    public static void createObjects() {
        
        leftTalon1 = new Talon(RobotMap.LEFT_TALON_1);
        leftTalon2 = new Talon(RobotMap.LEFT_TALON_2);
        rightTalon1 = new Talon(RobotMap.RIGHT_TALON_1);
        rightTalon2 = new Talon(RobotMap.RIGHT_TALON_2);
        
        drive = new RobotDrive(leftTalon1, leftTalon2, rightTalon1, rightTalon2);
        drive.setSafetyEnabled(true);
        
    }
    
}
RobotMap.java
Code:
package edu.wpi.first.wpilibj.templates;

public class RobotMap {
    
    public final static int LEFT_TALON_1 = 3;
    public final static int LEFT_TALON_2 = 4;
    public final static int RIGHT_TALON_1 = 1;
    public final static int RIGHT_TALON_2 = 2;
            
    public final static int LEFT_INTAKE = 7;
    public final static int RIGHT_INTAKE = 8;
            
    public final static int INTAKE_JAGUAR = 2;
            
    public final static int CATAPULT_LIMIT = 9;
            
    public final static int CATAPULT_LEFT = 5;
    public final static int CATAPULT_RIGHT = 4;
    
}
The print statement in teleopPeriodic() returns 0.0, and driveStick.getRawButton() at any button returns false.

Anyone got any ideas? I have no clue.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder



Last edited by Poseidon5817 : 12-05-2015 at 18:28.
Reply With Quote