   }
   
   //Reset the outputs to forward
-  PORTD=portd=B00000000;
-  PORTD=portd=B00000000;
-  PORTD=portd=B00000000;
+  PORTD=portd=portddirection=B00000000;
+  PORTB=portb=portbdirection=B00000000;
+  PORTC=portc=portcdirection=B00000000;
 }
 

  PORTD=portd;
  PORTB=portb;
  PORTC=portc;
}

//Resets all the pins

//Do the dirty work of actually toggling outputs to move the drive heads
void tick(){
  
  /* 
   * If there is a period set for control pin 2, count the number of
   * ticks that pass, and toggle the pin if the current period is reached.
