 
 	buildTest();
 
-	writeToBuffer("time, motor, t1, t2, volt, amp, thrust\n");
+	writeToBuffer("time, motor, RPM, t1, t2, volt, amp, thrust\n");
 
 	// start the log sampling ISR
+	attachInterrupt(TACH_PIN, tachISR, FALLING);
+	tachTime = 0;
+	lastTachPulse = 60000000*pulsesPerRev; //start tach at 1 rpm
+
 	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();

    a3 = getVolts( (uint16_t)ADCresult.result_adc0 );
    a4 = getAmps( (uint16_t)ADCresult.result_adc1 );
	*/


	rawTemp = (uint16_t)adc->analogRead(T1_PIN, ADC_0);
	a1 = getTemp(rawTemp);


	commandBuffer[0].mode = MODE_HOLD;
	commandBuffer[0].time = 1000;
	commandBuffer[0].value = 1000;
	commandBuffer[1].mode = MODE_HOLD;
	commandBuffer[1].time = 1000;
	commandBuffer[1].value = 1100;
	commandBuffer[2].mode = MODE_RAMP;
	commandBuffer[2].time = 4000;
	commandBuffer[2].value = 2000;
	commandBuffer[3].mode = MODE_HOLD;
	commandBuffer[3].time = 2000;
	commandBuffer[3].value = 2000;
	commandBuffer[4].mode = MODE_HOLD;
	commandBuffer[4].time = 1000;
	commandBuffer[4].value = 1100;
	commandBuffer[5].mode = MODE_HOLD;
	commandBuffer[5].time = 2000;
	commandBuffer[5].value = 1250;
	commandBuffer[6].mode = MODE_HOLD;
	commandBuffer[6].time = 1000;
	commandBuffer[6].value = 1100;
	commandBuffer[7].mode = MODE_HOLD;
	commandBuffer[7].time = 2000;
	commandBuffer[7].value = 1500;
	commandBuffer[8].mode = MODE_HOLD;
	commandBuffer[8].time = 1000;
	commandBuffer[8].value = 1100;
	commandBuffer[9].mode = MODE_HOLD;
	commandBuffer[9].time = 2000;
	commandBuffer[9].value = 1750;
	commandBuffer[10].mode = MODE_HOLD;
	commandBuffer[10].time = 1000;
	commandBuffer[10].value = 1100;
	commandBuffer[11].mode = MODE_HOLD;
	commandBuffer[11].time = 2000;
	commandBuffer[11].value = 2000;
	commandBuffer[12].mode = MODE_HOLD;
	commandBuffer[12].time = 1000;
	commandBuffer[12].value = 1100;
	commandBuffer[13].mode = MODE_HOLD;
	commandBuffer[13].time = 1000;
	commandBuffer[13].value = 1000;


}
