  * affect readings from the LSM303 compass and make them less
  * reliable.
  */
- 
+
 #define SPEED 200 // maximum motor speed when turning or going straight
 
 #define CALIB_SAMPLES 70

  {
    // Read in magnetic vector m
    compass.read();
    
    running_min.x = min(running_min.x, compass.m.x);
    running_min.y = min(running_min.y, compass.m.y);
  
    running_max.x = max(running_max.x, compass.m.x);
    running_max.y = max(running_max.y, compass.m.y);
    
    Serial.println(index);
    
    delay(50);
  }
  
  motors.setLeftSpeed(0);
  motors.setRightSpeed(0);
  
  Serial.print("max.x   ");
  Serial.print(running_max.x);
  Serial.println();

#include <Wire.h>
#include <LSM303.h>

/* This example uses the magnetometer in the Zumo Shield's onboard
 * LSM303DLHC to help the Zumo make precise 90-degree turns and drive
 * in squares. It uses the ZumoMotors, Pushbutton, and LSM303
 * (compass) libraries. The LSM303 library is not included in the Zumo
 * Shield libraries; it can be downloaded from GitHub at:
 *
 *   https://github.com/pololu/LSM303
 *
 * This program first first calibrates the compass to account for
 * offsets in its output. Calibration is accomplished in setup().
 *
 * In loop(), The driving angle then changes its offset by 90 degrees
 * from the heading every second. Essentially, this navigates the
 * Zumo to drive in square patterns.
 *
