 DaqTelemetry* daq()
 {
   daqTelemetry = new DaqTelemetry();
-
-  //generating an offset based off of the reference voltage sent from motor controller
-  double referenceVoltage = analogRead(referencePin);
-  int voltageOffset = 0; //realReference - referenceVoltage;      //currently depreciated until we can get an accurate voltmeter
-    
+  int voltageOffset;
+  if(useRef == true){
+    //generating an offset based off of the reference voltage sent from motor controller
+    double referenceVoltage = analogRead(referencePin);
+    voltageOffset = int(realReference - referenceVoltage);
+  }  
+  else{
+    voltageOffset = 0;
+  }
+  
   //Motor Calculations
-  double encoderVoltage = (analogRead(encoderPin)+voltageOffset)*.0049; //.0049 convert to real voltage values
+  double encoderVoltage = ( analogRead(encoderPin) + voltageOffset ) * 0.0049; //.0049 convert to real voltage values
   double scaledVoltage = encoderVoltage - scaleOffset;
   double finalRpm = scaledVoltage * rpmMultiplier;
   

   Reads a string from serial input and parses based off of our format
   specified in our documentation, then executes given command.
*/
void control_input()
{
  String input = Serial.readString();
  char codeArray[8]; //input string turned into an array
  input.toCharArray(codeArray, 6);



        //Changing the global direction for reference in the DAQ
        directionOfTravel = codeArray[2] == '0' ? 0 : 1; // one is forwards, zero is backwards
        logs = "motor code set to level to " + input.substring(1);
        break;
      }
    //LED code
