package com.easternedgerobotics.rov.io;

/**
 * A MPX4250 is an absolute pressure (AP) sensor. See also: <a href="http://goo.gl/n7c8tY">MPX4250</a>.
 */
public final class MPX4250AP {
    /**
     * Scalar value for calculating pressure from voltage.
     */
    private static final float PRESSURE_SCALAR = 0.264909785f;

    /**
     * Offset value for calculating pressure from voltage.
     */
    private static final float PRESSURE_OFFSET = 54.20054200f;

    /**
     * The ADC this device uses.
     */
    private final ADC channel;

    /**
     * Constructs a new MPX4250AP sensor on the given channel.
     * @param channel the ADC this device uses
     */
    public MPX4250AP(final ADC channel) {
        this.channel = channel;
    }

    /**
     * Returns the pressure.
     * @return the pressure
     */
    public final float read() {
        return channel.voltage() * PRESSURE_OFFSET - PRESSURE_SCALAR;
    }
}

@@ -34,16 +34,39 @@
 ov.io;%0A%0A
+import rx.Observable;%0A%0A
 /**%0A * A
@@ -474,24 +474,211 @@
 20054200f;%0A%0A
+    @SuppressWarnings(%22checkstyle:MagicNumber%22)%0A    public static final Observable.Transformer%3CDouble, Double%3E CALIBRATION = source -%3E source.map(%0A        x -%3E 0.83060f * x + 10.0445f);%0A%0A
     /**%0A    

Add pressure sensor calibration fn