 {
 DCU(0);//Turn off all lines
 delay (1000);
-Step(100,0);//rotate clockwise
+Step(100,0);//rotate clockwise 100 steps
 delay (1000);
-Step(100,1);// rotate counter clockwise
+Step(100,1);// rotate counter clockwise 100 steps
 } ;// end of loop
  
 void Step(int Steps, int direction)
 {
   int x;
-  int StepValue;if (direction ==0)
-    {
-      DCUStep[0]=5;//,9,10,6}; //on this order for CW
+  int StepValue;
+  if (direction ==0)
+    { 
+      /* 
+      The following sequences are for a "normal" stepper motor.
+      5,9,10,6 steps the motor CW
+      Reverse the order for CCW      
+      */
+      DCUStep[0]=5; //CW
       DCUStep[1]=9;
       DCUStep[2]=10;
       DCUStep[3]=6; 
     }
     else
      {
-       DCUStep[0]=6;//,9,10,6}; //on this order for CW
+       DCUStep[0]=6; //CCW
        DCUStep[1]=10;
        DCUStep[2]=9;
        DCUStep[3]=5; 
     }
   for (x=0; x<=Steps; x++) // set up step pattern
     {
-      output = x%4;
+      output = x%4;// % = modulo: returns the remainder of x divided by the value (4) in the case
+      //as "x" increments "output" will progress from 0, 1, 2, 3 repeating
       StepValue = DCUStep[output];
-      DCU(StepValue);
+      DCU(StepValue); // This points to the case for the DCU. See void DCU below.
       Serial.print(output);
       Serial.print("  ");
       Serial.println(StepValue);

Controls a stepper motor (unipolar or bipolar) connected to a Vernier Digital
Control Unit (DCU) connected to BTD 2 connector.

This sketch causes the stepper motor to rotate 100 steps and then the rotation
pauses for one second and the rotation is repeated in the opposite direction.
See www.vernier.com/arduino for more information.

*/int Duration=30; //step time in ms
int Direction =0;//direction 0 =CW, 1 = CCW
//the lines below are so that you can quickly change this code if you want to
//use the DCU in the BTD1 connector for some reason.

    } ;//end of for
};// end of Step
 
void DCU (int output)// This segment of code is copied from a DCU sketch as a complete module
{
  switch (output) 
  {
