 
   // Array with the errors
   double Z[3] = {(double) Z1, (double) Z2, (double) Z3};
-  writeAllToEEPROM ((double) Z1, (double) Z2, (double) Z3);
-
-}
-
-void loop() {
-  sCmd.readSerial();  // Read commands from serial port
+  // Write the errors
+  writeAllErrorsToEEPROM ((double) Z1, (double) Z2, (double) Z3);
+  
+  // Test: read the errors
   double a = readErrorFromEEPROM(1);
   double b = readErrorFromEEPROM(2);
   double c = readErrorFromEEPROM(3);

  Serial.print ("  |  "); Serial.print(c, 8);
  Serial.println("");
}

#include "SkyPointer_MotorShield.h"
#include <TimerOne.h>
#include <EEPROM.h>

// A modulo operator that handles negative numbers
#define MOD(a,b) ((((a)%(b))+(b))%(b))
