         Serial.print(quality);
         Serial.println(F(")"));
       }
-    }
-    angle++;    
+    }   
     break;
 
   case 8:
+    angle = data_4deg_index * 4 + 1; // 2nd angle in the set
     data0 = inByte;
     break;
 

}

void initEEPROM() {
  xv_config.id = 0x04;
  strcpy(xv_config.version, "1.2.1");
  xv_config.motor_pwm_pin = 9;  // pin connected N-Channel Mosfet

  xv_config.rpm_setpoint = 300;  // desired RPM
  xv_config.pwm_max = 1023;
  xv_config.pwm_min = 550;
  xv_config.sample_time = 20;
  xv_config.Kp = 1.0;
  xv_config.Ki = 0.5;
  xv_config.Kd = 0.00;

  xv_config.motor_enable = true;
  xv_config.raw_data = true;

} 
xv_config;

const byte EEPROM_ID = 0x05;  // used to validate EEPROM initialized

double pwm_val = 500;  // start with ~50% power
double pwm_last;
double motor_rpm;
unsigned long now;
unsigned long motor_check_timer = millis();
unsigned long motor_check_interval = 200;  
unsigned int rpm_err_thresh = 10;  // 2 seconds (10 * 200ms) to shutdown motor with improper RPM and high voltage
unsigned int rpm_err = 0;
unsigned long curMillis;
unsigned long lastMillis = millis();

