   }
 }
 
-// For continous rotation servos
-void rotateTo(float deg) {
-  
+// For stepper motors
+void rotateStepperBy(float deg) {
+  int steps = deg*5/9;
+  motor.step(steps);  
 }
 
 float readGyro() {


// Declare global variables
LSM9DS1 imu; // imu chip
Servo xy; // x-y plane servo

int n = 10; // gyro sample
int k = 200; // servo sample
int j = 0; // keep track of what to sample
float runningSum = 0;

float oldVal = 90;
float servoVal = 90; // initial value to set servo at
bool int_flag = false; // interrupt flag for executing gyro read every 100 ms
const int LED = 13; // indicator LED

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  setupIMU(); // set up hardware

  blinkLED(20, 10); // Let the use know everything initialized

  xy.attach(3); // pro mini / uno pwm pin
  xy.write(servoVal); // Start at a 90 degrees

  MsTimer2::set(n, a); // accepts ms argument
  MsTimer2::start(); // set up and start a timer interrupt

 * Arduino Uno Program - Controls Servo and Reads IMU                 *
 * Project: Eclipse Tracking (2017)                                   *
 * Version: 1.0 (3/18/2017)                                           *
 * Max Bowman / Jeremy Seeman / George Moe                            *
 **********************************************************************/
#include <Stepper.h>
#include <Wire.h>
#include <MsTimer2.h>
#include <SparkFunLSM9DS1.h>
