Package com.grt192.actuator

Source Code of com.grt192.actuator.GRTServo

/*
* Fixed Position Servo
* Reviewed AG 11/2/2009 -- OK
*/
package com.grt192.actuator;

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

/**
*
* @author Student
*/
public class GRTServo extends Actuator {

    private Servo servo;

    public GRTServo(int channel) {
        servo = new Servo(channel);
    }

    public void executeCommand(Command c) {
        double value = c.getValue();
        if (value > 0.0 && value < 360.0) {
            servo.setAngle(c.getValue());
        }
    }

    public void halt() {
        servo.setAngle(90);
    }

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

Related Classes of com.grt192.actuator.GRTServo

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.