Go to Post You have not only joined a robotic competition, you will discover that you are becoming a member of a very large and wonderful family. The more years that you participate, the larger your FIRST family will become. - Car Nack [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 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
 


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 17:59.

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