   }
 
   //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--;

  }        

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

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!
