package org.usfirst.frc.team3501.robot.commands.shooter;
import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.HallEffectSensor;
+import edu.wpi.first.wpilibj.Counter;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;
*/
public class RunFlyWheel extends Command {
Timer timer;
+ HallEffectSensor hallSource;
+ Counter hall;
private double motorVal;
private double time;
+ private int bufferLength = 15;
+ private int hallChannel = 0; // hallChannel=DIO channeL
/**
* See JavaDoc comment in class for details
timer = new Timer();
this.motorVal = motorVal;
this.time = time;
+
+ hall = new Counter(hallChannel);
+ hall.setMaxPeriod(1);
+
+ hallSource = new HallEffectSensor(hall, bufferLength);
}
// Called just before this Command runs the first time
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
+ double rotVel = hallSource.getRPS();
+
}
// Called once after isFinished returns true