                                 V_REF //reference voltage at full-scale
                               );
 
+//configure the DIGPOT chip
+MCP4xx1_DIGPOT8bitClass  offset_DIGPOT(A1,    //slaveSelectLowPin
+                                       100e3  //maxResistance
+                                      );
+
 
 void setup(){
   Serial.begin(BAUDRATE);
   
   //configure the serial commands
-  //SCmd.addCommand("*RST",    softwareReset);
-  //SCmd.addCommand("STATUS?", getStatusCommand);
-  //SCmd.addCommand("VCELL?",  getCellVoltageCommand);
-  //SCmd.addCommand("ICELL?",  getCellCurrentCommand);
- // SCmd.addCommand("VCTRL",   setControlVoltageCommand);
-  SCmd.addCommand("VSWEEP",  doSweepCommand);
-  SCmd.addCommand("VSWEEP_START",  setSweepStartCommand);
-  SCmd.addCommand("VSWEEP_END",    setSweepEndCommand);
-  SCmd.addCommand("VSWEEP_RAMP",   setSweepRampCommand);
-  SCmd.addCommand("VSWEEP_SAMPLE", setSweepSampleRateCommand);
-  //SCmd.addCommand("VSWEEP_CYCLES", setSweepCyclesCommand);
+  SCmd.addCommand("*RST",    softwareReset);
+  SCmd.addCommand("STATUS?", getStatusCommand);
+  SCmd.addCommand("VCELL?",  getCellVoltageCommand);
+  SCmd.addCommand("ICELL?",  getCellCurrentCommand); 
+
+  SCmd.addCommand("VCTRL",   setControlVoltageCommand);
+  SCmd.addCommand("VSWEEP!",       doSweepCommand); 
+  SCmd.addCommand("VSWEEP.START",  setSweepStartCommand);
+  SCmd.addCommand("VSWEEP.END",    setSweepEndCommand);
+  SCmd.addCommand("VSWEEP.RAMP",   setSweepRampCommand);
+  SCmd.addCommand("VSWEEP.SAMPLE", setSweepSampleRateCommand);
+  SCmd.addCommand("VSWEEP_CYCLES", setSweepCyclesCommand);
   
-  SCmd.setDefaultHandler(unrecognizedCommand);
+  //SCmd.addDefaultHandler(unrecognizedCommand);
   Serial.print("#<INIT>\n");
   //start up the SPI bus
   SPI.begin();
   SPI.setBitOrder(MSBFIRST);
   SPI.setDataMode(SPI_MODE0);
+  //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

    Serial.print("WE_current: ");
    Serial.print(WE_current, FLOAT_PRECISION_DIGITS);
    Serial.print('\n');
    Serial.print("offset_voltage: ");
    Serial.print(offset_voltage, FLOAT_PRECISION_DIGITS);
    Serial.print('\n');
    Serial.print("#</STATUS>\n");
  }

#include <SPI.h>
#include <MCP4921_DAC12bit.h>
#include <MCP320x_ADC12bit.h>
#include <MCP4xx1_DIGPOT8bit.h>
//3rd Party Libraries
#include <SerialCommand.h>
#include <TimerOne.h>      /*fast microsecond timer with interrupts*/
