Simple Stepper Example

In order for this example to work correctly you must make sure the number of steps per revolution is set for your stepper motor. This is the number of steps it takes for the motor to make one revolution. You can get this value from you motor's datasheet (if the number is not specified, divide the step angle by 360 degrees to get the number of steps per rev). This value usually ranges from 100 to 400 depending on the motor. The default value for this example is 200 stepsPerRev. If your motor has a different value, update the stepsPerRev variable on line 57 of this example.

If you are using an EasyDriver and have configured it to use less than 8 micro steps (default), then you'll need to update the number of microsteps in the numMicroSteps variable on line 56 of this example.

If you are not using an EasyDriver, set numMicroSteps = 1 and update the Interface parameter on line 77 to either Stepper.TWO_WIRE or Stepper.FOUR_WIRE depending on how you have wired the motor.