Guest User

Untitled

a guest
Dec 9th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <Stepper.h>
  2.  
  3. const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
  4. // for your motor
  5.  
  6. // initialize the stepper library on pins 8 through 11:
  7. Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
  8.  
  9. int stepCount = 0; // number of steps the motor has taken
  10.  
  11. void setup() {
  12. // initialize the serial port:
  13. Serial.begin(9600);
  14. }
  15.  
  16. void loop() {
  17. // step one step:
  18. myStepper.step(1);
  19. Serial.print("steps:" );
  20. Serial.println(stepCount);
  21. stepCount++;
  22. delay(500);
  23. }
Add Comment
Please, Sign In to add comment