View Single Post
  #10   Spotlight this post!  
Unread 15-01-2015, 20:27
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

Now I'm getting communications. It just says there's no robot code.
Code:
package org.usfirst.frc.team3335.robot;

/*----------------------------------------------------------------------------*/
/* 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.                                                               */
/*----------------------------------------------------------------------------*/

import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.vision.*;

public class Robot extends IterativeRobot {

    private Joystick controller;
    private RobotDrive drive;
    private SpeedController one, two, three, four, lift;
    private AxisCamera camera;
    private DigitalInput limit;

    public void robotInit() {
        joystickInit();
        sensorInit();
        robotDriveInit();
        speedControllerInit();
    }

    public void sensorInit() {
        limit = new DigitalInput(0);
    }

    public void joystickInit() {
        controller = new Joystick(0);
    }

    public void robotDriveInit() {
        drive = new RobotDrive(one, two, three, four);
    }

    public void speedControllerInit() {
        one = new Victor(0);
        two = new Victor(1);
        three = new Victor(2);
        four = new Victor(3);
        lift = new Victor(4);
    }

    public void autonomousPeriodic() {

    }

    public void teleopPeriodic() {
        double y = getDeadZone(controller.getY(), 0.1);
        double x = getDeadZone(controller.getThrottle(), 0.1);
        drive.arcadeDrive(y,x);
         if (controller.getAxis(Joystick.AxisType.kZ) > 0.8) {
                two.set(-1);
            } else if (controller.getAxis(Joystick.AxisType.kZ) < -0.8 && limit.get()) {
                two.set(1);
            } else {
                two.set(0);
            }
    }
    public void testPeriodic() {

    }

    public double getDeadZone(double axis, double zone) {

        return Math.abs(axis) > zone ? axis : 0;
    }
}
This should work, right?
__________________
Wait, what?

Last edited by Mr.Roboto3335 : 15-01-2015 at 20:30.
Reply With Quote