Added getAverageDistance() for ultrasonic sensor

It gets 12 values from the ultrasonic sensor, throws out the 2 extremes, and calculates the average from the remaining values.