Package com.grt192.core

Examples of com.grt192.core.Command


    public void fireBalloon(int balloon) {
        switch (balloon) {
            case 1: {
                if(hasBalloon1) {
                    getActuator("Balloon1").enqueueCommand(
                              new Command(GRTGPIORelay.RELAY_FORWARD, BALLOON_TIME));
                    getActuator("Balloon1").enqueueCommand(
                            new Command(GRTGPIORelay.RELAY_OFF));
                    hasBalloon1 = false;
                }
                break;
            }
            case 2: {
                if(hasBalloon2) {
                    getActuator("Balloon1").enqueueCommand(
                            new Command(GRTGPIORelay.RELAY_REVERSE, BALLOON_TIME));
                    getActuator("Balloon1").enqueueCommand(
                            new Command(GRTGPIORelay.RELAY_OFF));
                    hasBalloon2 = false;
                }
                break;
            }
            case 3: {
                if(hasBalloon3) {
                    getActuator("Balloon2").enqueueCommand(
                            new Command(GRTGPIORelay.RELAY_FORWARD, BALLOON_TIME));
                    getActuator("Balloon2").enqueueCommand(
                            new Command(GRTGPIORelay.RELAY_OFF));
                    hasBalloon3 = false;
                }
               
                break;
            }
            case 4: {
                if(hasBalloon4) {
                    getActuator("Balloon2").enqueueCommand(
                            new Command(GRTGPIORelay.RELAY_FORWARD, BALLOON_TIME));
                    getActuator("Balloon2").enqueueCommand(
                            new Command(GRTGPIORelay.RELAY_OFF));
                    hasBalloon4 = false;
                }
                break;
            }
        }
View Full Code Here


    }
    public boolean hitTop() {
        return getSensor("Switch2").getState("State") == Sensor.TRUE;
    }
    public void setSpeed(double a) {
        getActuator("Arm").enqueueCommand(new Command(a));
    }
View Full Code Here

    }

    //returns the Acceeleration given by the accelerometer

    public void setSpeed(int relayNum, double speed) {
        Command c = new Command(speed, 0); //100 millisec of sleep, so why does it say 0?
        getActuator("Victor" + relayNum).enqueueCommand(new Command(speed));
    }
View Full Code Here

        Command c = new Command(speed, 0); //100 millisec of sleep, so why does it say 0?
        getActuator("Victor" + relayNum).enqueueCommand(new Command(speed));
    }

    public void Forward(int relayNum) {
        getActuator("Relay" + relayNum).enqueueCommand(new Command(GRTRelay.RELAY_FORWARD));
    }
View Full Code Here

    public void Forward(int relayNum) {
        getActuator("Relay" + relayNum).enqueueCommand(new Command(GRTRelay.RELAY_FORWARD));
    }

    public void Off(int relayNum) {
        getActuator("Relay" + relayNum).enqueueCommand(new Command(GRTRelay.RELAY_OFF));
    }
View Full Code Here

    public void Off(int relayNum) {
        getActuator("Relay" + relayNum).enqueueCommand(new Command(GRTRelay.RELAY_OFF));
    }
       
    public void Reverse(int relayNum) {
        getActuator("Relay" + relayNum).enqueueCommand(new Command(GRTRelay.RELAY_REVERSE));
    }
View Full Code Here

        addActuator("Victor", new GRTVictor(victorPort));
        getActuator("Victor").start();
    }

    public void fire() {
        ((GRTVictor) getActuator("Victor")).enqueueCommand(new Command(speed));
        try {
            Thread.sleep(SHOOT_SLEEP);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
        ((GRTVictor) getActuator("Victor")).enqueueCommand(new Command(0));
    }
View Full Code Here

        }
        ((GRTVictor) getActuator("Victor")).enqueueCommand(new Command(0));
    }

    public void turnOn() {
        Command c = new Command(speed);
        getActuator("Victor").enqueueCommand(c);
    }
View Full Code Here

        Command c = new Command(speed);
        getActuator("Victor").enqueueCommand(c);
    }

    public void turnOff() {
        Command c = new Command(0);
        getActuator("Victor").enqueueCommand(c);
    }
View Full Code Here

    }

    public void moveArm() {
        if(armState == ARM_BACK) {
            getActuator("Arm").enqueueCommand(
                    new Command(GRTGPIORelay.RELAY_FORWARD));
            armState = ARM_FORWARD;
        }
        if(armState == ARM_FORWARD) {
            getActuator("Arm").enqueueCommand(
                    new Command(GRTGPIORelay.RELAY_FORWARD));
            armState = ARM_BACK;
        }
    }
View Full Code Here

TOP

Related Classes of com.grt192.core.Command

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.