10-01-2014 12:28 PM
Hey everyone
I am currently a physics student and for my final year project I am building a mini CT scanner which involves the use of two stepper motors. I currently have a program working which controlls the motors but i am having difficulty in reversing the rotation. Unlike conventional CT scanners, I must rotate the sample. Would anyone be able to help me figure out how to automatically change the case structure form true to false in order to reverse the stepper motor and without stopping the program.
Many thanks
John
10-01-2014 12:52 PM
You need to move your boolean control to be inside of the loop. As of right now, that control is only read once before the loop. By moving it inside, you can read it every iteration.
10-01-2014 01:02 PM
thanks for the reply. Yes the rotation can now be changed when the program is running but i need help with automatically changing the motor orientation e.g after a certain time interval
10-01-2014 01:06 PM
From this point, it is just a matter of figuring out what logic you want to be in place of that control.
You can go by the number of iterations and switch if you go beyond a certain count. You could go by your rotations completed. It is just a simple comparison.