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

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

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

Device iout("iout", 3, iout.analog, iout.in);
Device light("light", 5, light.analog, light.out);
Timer time;
Timer statustime;
Timer controltime;

Servo tilt;
// IMPORTANT!
