View Single Post
  #1   Spotlight this post!  
Unread 11-02-2011, 21:21
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
This Code worked, then it didn't

Hello, I have made code for my team's minibot deployment system. It worked once, then never again

Code:
package com.robototes.abomasnow;

import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Timer;

public class MinibotDeployment {
    Jaguar armSwingyMotor;
    LimitSwitch thePole;

    MinibotDeployment(int vicPort, int swiPort) {
        //the thing that sets crap up
        this.armSwingyMotor = new Jaguar(4, vicPort);
        this.thePole = new LimitSwitch(swiPort, 14);
    }

    void hitThePole(Driver robot) {
        robot.stop();
        double time = Timer.getFPGATimestamp();
        while ((Timer.getFPGATimestamp() < time + 5.0f) && this.thePole.getLeftWays()) {
            System.out.println(';');
            this.armSwingyMotor.set(0.25);
        }
        this.armSwingyMotor.set(0);
    }

    void resetArm() {
        
    }
}
Limitswitch:
Code:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.robototes.abomasnow;

import edu.wpi.first.wpilibj.DigitalInput;

public class LimitSwitch {
    DigitalInput one;
    DigitalInput two;

    LimitSwitch(int port, int otherPort) {
        one = new DigitalInput(4, port);
        two = new DigitalInput(4, otherPort);
    }

    boolean getLeftWays() {
        return this.one.get();
    }

    boolean getRightWays() {
        return this.two.get();
    }

    boolean[] get() {
        boolean[] foo = {this.getLeftWays(), this.getRightWays()};
        return foo;
    }
}
resetArm is supposed to be blank.

Where did I screw up?

Last edited by Robototes2412 : 11-02-2011 at 21:39. Reason: forgot LimitSwitch code
Reply With Quote