<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.powercord869.code.robot.autonomous;

import com.powercord869.code.robot.Fan;
import edu.wpi.first.wpilibj.DriverStation;

/**
 *
 * @author Computer
 */
public class DriveAndRunFanRoutine extends AutonomousRoutine {
    
    private Fan fan;
    private boolean timerStarted = false;

    public DriveAndRunFanRoutine() {
        setDistanceToTravel(EncoderControl.CLICKS_PER_INCH * DriverStation.getInstance().getAnalogIn(1) * 1000);
        fan = getFan();
    }

    public void run() {

        drive(getDistanceToTravel());
        if (distanceTraveled >= getDistanceToTravel()) {
            if (!timerStarted) {
                time.start();
                timerStarted = true;
            } else {
                if (time.get() < (driverStation.getAnalogIn(3) * 1000)) {
                    fan.moveFan(1);
                } else if (time.get() > (driverStation.getAnalogIn(3) * 1000) && time.get() < (driverStation.getAnalogIn(3) * 1000) + 1000) {
                    fan.moveFan(0);
                    fan.oscillateFan(1);
                } else {
                    fan.oscillateFan(0);
                    fan.moveFan(0);
                }
            }
        }

    }

    public boolean validate() {

        return getDriverStation().getDigitalIn(2);
    }

    public void stop() {
        fan.oscillateFan(0);
        fan.moveFan(0);
        time.stop();
        time.reset();
    }
}<commit_msg>fixed some bugs in the drive and shoot routine, only the multiplyer on the time to fit microseconds and resetting the timer, its fine if u did the merging already chin, I can do this at lehigh.<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.powercord869.code.robot.autonomous;

import com.powercord869.code.robot.Fan;
import edu.wpi.first.wpilibj.DriverStation;

/**
 *
 * @author Computer
 */
public class DriveAndRunFanRoutine extends AutonomousRoutine {
    
    private Fan fan;
    private boolean timerStarted = false;

    public DriveAndRunFanRoutine() {
        setDistanceToTravel(EncoderControl.CLICKS_PER_INCH * DriverStation.getInstance().getAnalogIn(1) * 1000);
        fan = getFan();
    }

    public void run() {

        drive(getDistanceToTravel());
        if (distanceTraveled >= getDistanceToTravel()) {
            if (!timerStarted) {
                time.start();
                timerStarted = true;
            } else {
                if (time.get() < (driverStation.getAnalogIn(3) * 1000000)) {
                    fan.moveFan(.4);
                } else if (time.get() > (driverStation.getAnalogIn(3) * 1000000) && time.get() < (driverStation.getAnalogIn(3) * 1000000) + 1000000) {
                    fan.moveFan(0);
                    fan.oscillateFan(1);
                } else {
                    fan.oscillateFan(0);
                    fan.moveFan(0);
                }
            }
        }

    }

    public boolean validate() {

        return getDriverStation().getDigitalIn(2);
    }

    public void stop() {
        time.reset();
        timerStarted = false;
        fan.oscillateFan(0);
        fan.moveFan(0);
        time.stop();
        time.reset();
    }
}
{'fraction_non_alphanumeric': 0.1129757267006293, 'fraction_numerical': 0.02637099190890021, 'mean_word_length': 1.9383802816901408, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4154942', 'n_tokens_mistral': 1087, 'n_tokens_neox': 952, 'n_words': 211}