11/*
2- Stepper.h - - Stepper library for Wiring/Arduino - Version 0.4
2+ Stepper.h - - Stepper library for Wiring/Arduino - Version 0.5
33
44 Original library (0.1) by Tom Igoe.
55 Two-wire modifications (0.2) by Sebastian Gassner
66 Combination version (0.3) by Tom Igoe and David Mellis
77 Bug fix for four-wire (0.4) by Tom Igoe, bug fix from Noah Shibley
8+ High-speed stepping mod and timer rollover fix (0.5) by Eugene Kozlenko
89
910 Drives a unipolar or bipolar stepper motor using 2 wires or 4 wires
1011
1819 A slightly modified circuit around a Darlington transistor array or an L293 H-bridge
1920 connects to only 2 microcontroler pins, inverts the signals received,
2021 and delivers the 4 (2 plus 2 inverted ones) output signals required
21- for driving a stepper motor.
22+ for driving a stepper motor. Similarly the Arduino motor shields 2 direction pins
23+ may be used.
2224
2325 The sequence of control signals for 4 control wires is as follows:
2426
@@ -79,7 +81,7 @@ class Stepper {
7981
8082 int direction; // Direction of rotation
8183 int speed; // Speed in RPMs
82- unsigned long step_delay; // delay between steps, in ms , based on speed
84+ unsigned long step_delay; // delay between steps, in us , based on speed
8385 int number_of_steps; // total number of steps this motor can take
8486 int pin_count; // whether you're driving the motor with 2 or 4 pins
8587 int step_number; // which step the motor is on
@@ -90,7 +92,7 @@ class Stepper {
9092 int motor_pin_3;
9193 int motor_pin_4;
9294
93- long last_step_time; // time stamp in ms of when the last step was taken
95+ unsigned long last_step_time; // time stamp in us of when the last step was taken
9496};
9597
9698#endif
0 commit comments