Hi, i am not sure if this is the correct forum (if not then feel free to move the post), but I am in a senior design team at USF, and i am in the process of using an arduino uno to program our thermal sentry gun to know when to turn/stop/etc. i have accomplished most of it, but i am having trouble getting the gun to return to its original position after it "eliminates" the threat(s). I was thinking of trying to define some sort of a reset procedule that i can call whenever necessary to essentially start everything over. Is there any advice you can give me not only on how to actually use that type of command, and also maybe a method to return our motor to its original position? programming isnt exactly my strong suit.
sorry, i guess i should have explained better. we have a center sensor as well as left and right sensors. the motor will stop to fire on the center sensor input. I currently have most of the code written to recognize the heat and move in the correct direction until the center sensor sees something. The issue is that we are only going to have around 180 degrees of vision, and thus whenever the gun isnt actually doing anything, we would like for it to be facing "forward." I currently am not sure how to establish a specific position in the beginning and be able to return to it at a given time
I have not had time to test much of this yet (due to miscommunication a few days ago, my partner has the hardware), so most of this was done in one sitting. I know there are probably still issues with it. I only have a small background in C++, and the commands that i remember from that language for functions dont seem to be recognized by the arduino. :~
Light a small fire in front of the gun. Then it will swivel back to face the fire. Now imagine that the fire is there, rather than really there. What part of the code do you need to execute to make it think it is facing this fire?
Since you have no feedback to tell you where the turret is pointing, the only thing I can think of with the hardware as is, is to use millis to keep count of how much time you spent with the motors moving left and moving right. The difference should be approximately what you need to undo to return to your initial position.