Code

In order to use code for the stepper motor, I had to install a new library on my Arduino called AF_Stepper. The directions on how to download the library can be found here. A page that I found to be really helpful in getting the motor to just move was this. It gives you the basics and what's required to actually make the thing move. This seems like the website that Alex used last year to get his code, but I ended up making my own code to make the motor do what I want it to do.

The code that I came up with starts the motor and makes it move 31.5 steps, about one degree, and then it waits 30 seconds and repeat. The 30 seconds is to give the GM Tube/counter enough time to get an accurate reading of the radiation at each degree around the sample. I'm still in the process of editing it to make it simpler so I'll update that when I'm done with it, but this is what I have for now.




When using the system to collect data, the GM Tube will only be able to go around half of the specimen as the tube will not be able to go any further around due to the motor being in the way. So, the user will have to manually take the motor from one side and place it on the other side. This will make the user have to change the code if he or she wants it to continuously go from +120 to -120. In order to achieve this, the user had to change the moto.step in the loop from BACKWARD to FORWARD. The new line of code should look like:

Everything else in the code should remain untouched.


Comments

Popular posts from this blog

Turning the Motor On