Go to Post FIRST is not about a robot competition . . there just happens to be one at every FIRST event. - Stuart [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 12-05-2015, 18:24
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
"Cool" Squad
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 360
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
 


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 08:42.

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