<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.RobotCode623;


/**
 *
 * @author samwinkelstein
 */
import edu.wpi.first.wpilibj.AnalogChannel;
import edu.wpi.first.wpilibj.DigitalOutput;

public class ultraSonic_Alog extends AnalogChannel {
    private int type;
    private static final double vpi1 = 0.0098;
     private static final double vpi2 = 0.00838;
     public DigitalOutput out;
    //ez4 = 1; urm = 2;
    public ultraSonic_Alog(int channel, int type)
    {
        
         super(channel);
        this.type = type;
       
    }
     // get distancein feet
    public double getDistance(){
        double vpi = 0;
        if(type == 1)
        {
            vpi = vpi1;
        }
        else
        {
            vpi = vpi2;
        }
        return (getVoltage()/vpi)/12;            
    }
    
    
}
<commit_msg>Clean up ultrasonic code.<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.RobotCode623;

/**
 *
 * @author samwinkelstein
 */
import edu.wpi.first.wpilibj.AnalogChannel;

public class ultraSonic_Alog extends AnalogChannel {
    private final double vpi;
    private static final double vpi1 = 0.0098;
    private static final double vpi2 = 0.00838;
    //ez4 = 1; urm = 2;
    public ultraSonic_Alog(int channel, int type) {
        super(channel);
        if (1 == type) {
            vpi = vpi1;
        } else {
            vpi = vpi2;
        }
    }
     // get distancein feet
    public double getDistance(){
        return (getVoltage()/vpi)/12;            
    }
}

{'fraction_non_alphanumeric': 0.0988235294117647, 'fraction_numerical': 0.028823529411764706, 'mean_word_length': 1.9894551845342707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7148592', 'n_tokens_mistral': 587, 'n_tokens_neox': 555, 'n_words': 147}