|
help with turret code
right now im attempting to write some code for our turret to scan back and forth across the field between two limit switched until a large enough target is seen. I just had one failed attempted in which I created a state machine using some boolean operators to modify the direction of the motor based on which of the two limit switches was hit and which direction the motor was last commanded to go. The motor flickered back and forth. I think it had something to do with passing the last motor command to a shift register for evaluation the next cylce.
I'm wondering if anyone has any suggestions that are simple that I can use? Only got a day left and really want to get our turret working for testing tomorrow. I'm sure that this has been done before.
One suggestion was to just stop the motor however I want the turret to "scan" back and forth across the field.
Suggestions much appreciated! Mahalo!
|