J A Hawtin
Member
Hi!
Can someone help me or at least point me in the right direction.
Attached is a simple bit of code that I use to drive a stepper motor either clockwise or anticlockwise for a given number of steeps as determined by the sub routines ‘rotater’ and ‘rotatel’ which in itself works OK. But what if we start the motor rotating with the appropriate subroutine but instead of specifying a set number of steeps the motor rotates until another condition is met – say pin3 goes high or a set input pulse count is reached or some other controlling input. If this is possible, how do I write the code? Where do I start?
I’m using a 28X1 simply because that happened to be on the bread board from a previous project. The motor driver is a L293D.
Can someone help me or at least point me in the right direction.
Attached is a simple bit of code that I use to drive a stepper motor either clockwise or anticlockwise for a given number of steeps as determined by the sub routines ‘rotater’ and ‘rotatel’ which in itself works OK. But what if we start the motor rotating with the appropriate subroutine but instead of specifying a set number of steeps the motor rotates until another condition is met – say pin3 goes high or a set input pulse count is reached or some other controlling input. If this is possible, how do I write the code? Where do I start?
I’m using a 28X1 simply because that happened to be on the bread board from a previous project. The motor driver is a L293D.
Attachments
-
512 bytes Views: 25