   float WE_current_sense_voltage;     //voltage across current follower sense resistor, ref. to power rails
   float WE_current;                   //compute current into WE
   float WE_current_sense_offset_voltage; //referenced to power rails
-  char *arg;
-  arg = SCmd.next();
-  if (arg != NULL)
-  {
-    Serial.println("### Error: STATUS? - requires 0 arguments ###");
+  float current_sense_resistance = _currsense_resistors[_currsense_range];
+  char *arg;
+  arg = SCmd.next();
+  if (arg != NULL)
+  {
+    Serial.println(F("### Error: STATUS? - requires 0 arguments ###"));
   }
   else
   {
     control_voltage = control_DAC.getVoltageOutput() - V_VGND; //shift back from center-rail
     //read signals
-    RE_voltage                      = sense_ADC.readSingle(0) - V_VGND;
-    WE_current_sense_voltage        = sense_ADC.readSingle(1) - V_VGND;
-    WE_current_sense_offset_voltage = sense_ADC.readSingle(2) - V_VGND;
+    RE_voltage                      = sense_ADC.readSingle(ADC_CHANNEL_VOLTAGE)        - V_VGND;
+    WE_current_sense_voltage        = sense_ADC.readSingle(ADC_CHANNEL_CURRENT)        - V_VGND;
+    WE_current_sense_offset_voltage = sense_ADC.readSingle(ADC_CHANNEL_CURRENT_OFFSET) - V_VGND;
     //convert to centerline voltage
     WEtoRE_voltage = -RE_voltage;
     //sesning current flows in opposite direction to current flowing into WE
-    WE_current     = -WE_current_sense_voltage/R_CURRSENSE;
+    WE_current     = -WE_current_sense_voltage/current_sense_resistance;
     //format as YAML
-    Serial.print("#<STATUS>\n");
-    Serial.print("---\n");
-    Serial.print("control_voltage: ");
+    Serial.print(F("#<STATUS>\n"));
+    Serial.print(F("---\n"));
+    Serial.print(F("control_voltage: "));
     Serial.print(control_voltage, FLOAT_PRECISION_DIGITS);
     Serial.print('\n');
-    Serial.print("WEtoRE_voltage: ");
+    Serial.print(F("WEtoRE_voltage: "));
     Serial.print(WEtoRE_voltage, FLOAT_PRECISION_DIGITS);
     Serial.print('\n');
-    Serial.print("WE_current: ");
+    Serial.print(F("WE_current: "));
     Serial.print(WE_current, FLOAT_PRECISION_DIGITS);
     Serial.print('\n');
-    Serial.print("WE_current_sense_voltage: ");
+    Serial.print(F("current_sense_resistance: "));
+    Serial.print(current_sense_resistance, FLOAT_PRECISION_DIGITS);
+    Serial.print('\n');
+    Serial.print(F("WE_current_sense_voltage: "));
     Serial.print(WE_current_sense_voltage, FLOAT_PRECISION_DIGITS);
     Serial.print('\n');
-    Serial.print("WE_current_sense_offset_voltage: ");
+    Serial.print(F("WE_current_sense_offset_voltage: "));
     Serial.print(WE_current_sense_offset_voltage, FLOAT_PRECISION_DIGITS);
     Serial.print('\n');
-    Serial.print("#</STATUS>\n");
+    Serial.print(F("#</STATUS>\n"));
   }
 }
 

  //configure the offset to the centerline
  offset_DIGPOT.begin();
  offset_DIGPOT.writeVolatileWiper0(DIGPOT_N_INIT);
  //start controlling the voltage supply
  control_DAC.begin(V_INIT);
  //start controlling the sampling
  sense_ADC.begin();
  Serial.print("#OLM Potentiostat v0.1\n");
  Serial.print("#</INIT>\n");
}

void loop(){

    v_start = atof(arg);
    if (v_start < V_MIN || v_start > V_MAX)
    {
      Serial.print(F("### Error: VSWEEP_START must have ("));
      Serial.print(V_MIN,3);
      Serial.print(F(" <= v_start <= "));
      Serial.print(V_MAX,3);
      Serial.print(F("), got:"));
      Serial.print(v_start,3);
      Serial.print(F(" ###\n"));
      return;
    }
    _sweep_v_start = v_start;
  }
  else
  {
    Serial.println(F("### Error: VSWEEP_START - requires 1 argument (float v_start) ###"));
  }
}

