 int setUStep(int us) {
 
   switch (us) {
+  case 0: {
+    digitalWrite(M0, LOW);
+    digitalWrite(M1, LOW);
+    digitalWrite(M2, LOW);
+    Serial.println("Set to no microsteps");
+    return 1;
+  }
   case 8: {
     digitalWrite(M0, HIGH);
     digitalWrite(M1, HIGH);

#define TRIG 2

// Hardcoded number of steps in the motor I'm using
#define STEPS_PER_REV 24

AccelStepper stepper(1, STEP, DIR);
long num_turns = 100;
long usteps = 8;
volatile bool moving = false;
volatile bool state_change = false;
const int led = LED_BUILTIN; 

      usteps = setUStep(usteps);

      // Set max stepper speed in turns/sec
      double max_speed = 500;
      stepper.setMaxSpeed(max_speed);
      stepper.setAcceleration(max_speed/5);
  }
