 /* This example shows basic use of the AMIS-30543 stepper motor
 driver.
 
-It shows how to initialize the dirver, set the current limit, set
+It shows how to initialize the driver, set the current limit, set
 the micro-stepping mode, and enable the driver.  It shows how to
-send pulses to the step pin to get the driver to take steps and
-how to switch directions over SPI.  The DO and DIR pins are not
-used and do not need to be connected.
+send pulses to the NXT/STEP pin to get the driver to take steps
+and how to switch directions using the DIR pin.  The DO pin is
+not used and does not need to be connected.
 
 Before using this example, be sure to change the
 setCurrentMilliamps line to have an appropriate current limit for

  delay(300);

  // Step in the other direction 1000 times.
  stepper.setDirection(1);
  for (unsigned int x = 0; x < 1000; x++)
  {
    step();


const uint8_t amisSlaveSelect = 4;
const uint8_t amisStepPin = 5;
const uint8_t amisDirPin = 6;

AMIS30543 stepper;

void setup()
{
  SPI.begin();
  stepper.init(amisSlaveSelect);

  // Drive the NXT/STEP and DIR pins low initially.
  digitalWrite(amisStepPin, LOW);
  pinMode(amisStepPin, OUTPUT);
  digitalWrite(amisDirPin, LOW);
  pinMode(amisDirPin, OUTPUT);

  // Give the driver some time to power up.
  delay(1);

  // Reset the driver to its default settings.
  stepper.resetSettings();

  // Set the current limit.  You should change the number here to
  // an appropriate value for your particular system.
  stepper.setCurrentMilliamps(135);

  // Set the number of microsteps that correspond to one full step.
  stepper.setStepMode(32);

  // Enable the motor outputs.
  stepper.enableDriver();
}

void loop()
{
  // Step in the default direction 1000 times.
  setDirection(0);
  for (unsigned int x = 0; x < 1000; x++)
  {
    step();
