   }
 
   //to reduce AMP spikes, smooth large power adjustments out
-  if (time.elapsed (100)) {
+  if (controltime.elapsed (100)) {
     if (p<c_motorp) c_motorp--;
     if (p>c_motorp) c_motorp++;
     if (v<c_motorv) c_motorv--;

  motors.reset();
  
  time.reset();

// initialize all the readings to 0: 
  for (int thisReading = 0; thisReading < numReadings; thisReading++)

  }        

  // send voltage and current
  if (statustime.elapsed(1000)) {
    vout.send(vout.read());
    iout.send(average);
    Serial.print("time:");
