/*
 * 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;            
    }
    
    
}

@@ -138,17 +138,16 @@
 de623;%0A%0A
-%0A
 /**%0A *%0A 
@@ -222,52 +222,8 @@
 nel;
-%0Aimport edu.wpi.first.wpilibj.DigitalOutput;
 %0A%0Apu
@@ -285,24 +285,32 @@
 private 
+f
 in
-t type
+al double vpi
 ;%0A    pr
@@ -354,17 +354,16 @@
 98;%0A    
- 
 private 
@@ -402,39 +402,8 @@
 38;%0A
-     public DigitalOutput out;%0A
     
@@ -475,25 +475,11 @@
 ype)
-%0A    %7B%0A        %0A 
+ %7B%0A
     
@@ -510,154 +510,63 @@
     
-this.type = type;%0A       
+if (1 == type) %7B
 %0A    
-%7D%0A
      
-// get distancein feet%0A    public double getDistance()%7B%0A        double vpi = 0;%0A        if(type == 1)%0A       
+   vpi = vpi1;%0A        %7D else
  %7B%0A 
@@ -577,33 +577,33 @@
        vpi = vpi
-1
+2
 ;%0A        %7D%0A    
@@ -606,60 +606,70 @@
     
-    else%0A        %7B%0A            vpi = vpi2;%0A        %7D
+%7D%0A     // get distancein feet%0A    public double getDistance()%7B
 %0A   
@@ -725,16 +725,6 @@
   %7D%0A
-    %0A    %0A
 %7D%0A

Clean up ultrasonic code.