 void updateScaleValue() {
 	// update the global measurement value, but only if the scale is ready to be read
 	if (scale.is_ready()){
-		scaleValue = scale.get_value();
-	}
-}
+		scaleValue = scale.get_units();
+	}
+}

	pinMode(BUTTON_PIN, INPUT_PULLUP);

	adc->setReference(ADC_REF_EXT, ADC_0);
    adc->setAveraging(1, ADC_0); // set number of averages
    adc->setResolution(16, ADC_0); // set bits of resolution
    adc->setConversionSpeed(ADC_HIGH_SPEED_16BITS, ADC_0); // change the conversion speed
    adc->setSamplingSpeed(ADC_HIGH_SPEED_16BITS, ADC_0); // change the sampling speed

	adc->setReference(ADC_REF_EXT, ADC_1);
    adc->setAveraging(1, ADC_1); // set number of averages
    adc->setResolution(16, ADC_1); // set bits of resolution
    adc->setConversionSpeed(ADC_HIGH_SPEED_16BITS, ADC_1); // change the conversion speed
    adc->setSamplingSpeed(ADC_HIGH_SPEED_16BITS, ADC_1); // change the sampling speed

    adc->enableCompare(1.0/2.5*adc->getMaxValue(ADC_0), 0, ADC_0); // measurement will be ready if value < 1.0V
    adc->enableCompare(1.0/2.5*adc->getMaxValue(ADC_1), 0, ADC_1); // measurement will be ready if value < 1.0V

	Serial.println("logging...");

	buildTest();

	writeToBuffer("time, motor, t1, t2, volt, amp, thrust\n");

	// start the log sampling ISR
	logSampler.priority(200); // set lowish priority.  We want to let regular fast ISRs (like servo timing) to be able to interrupt
	logSampler.begin(log, 5000); // start logger, 1000 micros = 1khz, 10000micros = 100hz
	runCurrentCommand();

	bool running = true;
