Package com.grt192.actuator

Source Code of com.grt192.actuator.GRTSolenoid

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package com.grt192.actuator;

import com.grt192.core.Actuator;
import com.grt192.core.Command;
import edu.wpi.first.wpilibj.Solenoid;

/**
*
* @author Student
*/
public class GRTSolenoid extends Actuator{
    private Solenoid solenoid;
    public static final double ON = 1.0;
    public static final double OFF = 0.0;
   
    public GRTSolenoid(int channel) {
        solenoid = new Solenoid(channel);
    }

    public void executeCommand(Command c) {
        if(c.getValue() == ON) {
            solenoid.set(true);
        } else if(c.getValue() == OFF) {
            solenoid.set(false);
        }
    }

    protected void halt() {
        solenoid.set(false);
    }

    public String toString() {
        return "Solenoid";
    }
}
TOP

Related Classes of com.grt192.actuator.GRTSolenoid

TOP
Copyright © 2018 www.massapi.com. 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.