Looking for simple stepper code
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 19
- Joined: Thu Mar 22, 2012 1:28 am
Looking for simple stepper code
Okay,,complete newbie,,finally on my 2nd UNO and 3rd motor shield (don't ask,,hah) and have my Uno talking with the shield and talking with my stepper. I verify and up load the Adafruit motor library and all works fine. What I am looking for is simple code to run the motor x amount of steps forward, pause, and run the same amount of steps forward again. I am using the 12 volt 200 step motor from our favorite site (Adafruit), 9v power supply, Uno, and of course the Adafruit motor shield. Anybody care to assist this old man?
- adafruit_support_bill
- Posts: 88090
- Joined: Sat Feb 07, 2009 10:11 am
Re: Looking for simple stepper code
That part of it would be:run the motor x amount of steps forward, pause, and run the same amount of steps forward again.
Code: Select all
motor.step(100, FORWARD, SINGLE);
delay(1000); // 1000 milliseconds = 1 second
motor.step(100, FORWARD, SINGLE);
-
- Posts: 19
- Joined: Thu Mar 22, 2012 1:28 am
Re: Looking for simple stepper code
Thank you very much! I'm actually working on a telecine system and it's very much in it's baby steps. I plan on using the motor to advance 8mm/Super8 film and I just wanted to see if the motor would be exact enough for my requirements. I have not decided how I will trigger the motor & camera set up yet. The camera is a simple usb webcam. My idea is to use the motor- advance film x amount of steps - pause - trigger camera - etc. The webcam will be connected via usb to my computer for capture. Also, the webcam had a switch to trigger a single photo which will be my next hurdle. I need to figure out how to trigger the camera during the delay state of the code you sent me. Preferably an electronic switch. Again, thank you for your assistance.
Please be positive and constructive with your questions and comments.