     //!  speed control
     delay(10000/(state->spd));
   }
+  indicate(false);
 }
 
 //!  @brief :  micro stepping
 //!  @speed range:  [10,500]
 void micr(const State* state)
 {
+    indicate(true);
     //!  specify the starting index according to the direction  	
     const unsigned arr[32] = 
     {500, 625, 750, 875, 1000, 875, 750, 625, 500, 375, 250, 125, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ,0, 125, 250, 375};

void half(const State* state);
void micr(const State* state);
void pwm(unsigned pin, unsigned period, unsigned duty);

void setup() 
{                
  pinMode(A, OUTPUT);     
  pinMode(B, OUTPUT);     
  pinMode(C, OUTPUT);     
  pinMode(D, OUTPUT);     
}

void loop() 

const int B = 9;
const int C = 10;
const int D = 11;
const int indicator = 13;

//!  struct storing the state information
class State
