 
   if (pidTimer >= timeStep)
   {
-    if (prevSetpoint != cartPid.setpoint) printStatus(cartPid);
+    if (prevSetpoint != cartPid.setpoint) { printStatus(cartPid); }
     pidTimer -= timeStep;
     float input = float(trackEncoder.read())/xMax;
     cartPid.update(input, 0.001);

float pwmFreq = 2929.687; // See http://www.pjrc.com/teensy/td_pulse.html
float dutyCycle = 0;  // Percent

unsigned long timeStep = 15; // ms

Encoder trackEncoder(TRACK_ENCODER_PIN_A, TRACK_ENCODER_PIN_B);
Encoder thetaEncoder(PENDULUM_ENCODER_PIN_A, PENDULUM_ENCODER_PIN_B);

// PID control for cart position
float kp = 2, ki = 10, kd = 0;
elapsedMillis pidTimer = 0;
PIDControl cartPid(kp, ki, kd, 0, timeStep);

/**
 * Find limits using bump switches and center cart between them.
 */
ExecStatus reset(CommandLine *clp)
{
  elapsedMillis resetTimer = 0;
  unsigned long maxTime = 5000;

#define DIR_PIN 12
#define CART_RESET_PIN 21

float prevSetpoint = 0; // temp - debug

// For incoming serial data
