 }
 
 /*
+ * Print milliamperes.
+ */
+void print_uamp(int uamp)
+{
+    Serial.print(uamp / 1000.0, 2);
+    Serial.write("mA");
+}
+
+/*
  * Measure gate voltage.
  * Repeat until the value is stable for 3 attempts.
  */

#define DRAIN_MULT      (((33 + 10) / 10.0) * CALIBRATE_DRAIN)      // resistors 33k and 10k
#define POWER5_MULT     (((10 + 10) / 10.0) * CALIBRATE_POWER5)     // resistors 10k and 10k
#define POWER15_MULT    (((33 + 10) / 10.0) * CALIBRATE_POWER15)    // resistors 33k and 10k

/*
 * Read a character from the serial port.

 * Measure drain voltage.
 * Repeat until the value is stable for 3 attempts.
 */
void measure_drain_voltage()
{
    delay(1);
    drain_input = analogRead(A1);
