   motors.reset();
   
   time.reset();
+
+// initialize all the readings to 0: 
+  for (int thisReading = 0; thisReading < numReadings; thisReading++)
+    readings[thisReading] = 0;     
 }
 
 void loop(){

    }
  }

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

// array[0] will be the number of arguments in the command
int array[MAX_ARGS];

// Define the number of samples to keep track of.  The higher the number,
// the more the readings will be smoothed, but the slower the output will
// respond to the input.  Using a constant rather than a normal variable lets
// use this value to determine the size of the readings array.
const int numReadings = 10;

int readings[numReadings];      // the readings from the analog input
int index = 0;                  // the index of the current reading
int total = 0;                  // the running total
int average = 0;                // the average

void setup(){

