Wednesday, November 11, 2009

Final Project Update

I've been experimenting with servos (basically the ones we have in the classroom, I'm going to buy the same kind). The point right now is to figure out how to get the servos to turn the right degree when an analog input is high.
The problem with the code on the ITP site ( http://itp.nyu.edu/physcomp/Labs/Servo ) is that it deals with changing input to designate changing output (potentiometer readings to determine the pulse of the servo). This is not what I need. I need the simplest version of this. Even on the arduino website itself, there is only a code for the pulsing of the arduino. What I basically want is for the motor to turn about 180 degrees when the button (analog sensor) is on HIGH (when it is pressed and the circuit is complete) and then for it to return to it's original position. In this way, the servo does not have to have a lot of "strength" (my brain can't remember the correct term for this) or have a wind-up device to continuously pull tighter and tighter, rather just tug, constantly. Nothing is ever pulled without losing momentum in the metaphorical sense, unless it happens continuously without a lapse in time, and then even the movement is relative to the position it was in before and the environment around it. (Note to self - try to define this more clearly).
So, in order to get this thing to do what I want it to do (which I think is really very very simple, but then again my experience in this sort of thing is very limited), I've been searching high and low on forums and projects that other people have done. I did find this: ( http://www.tigoe.net/pcomp/code/category/code/arduinowiring/31 ) It worked for about half a minute and then the servos would not respond to the input, instead they would just sit there and make a strange little humming noise. It was very perturbing. But I got two servos to work at the same time, even if it was for a very small amount of time. My thought on this are that maybe the math in the code had something to do with it... and that it just stopped all together after it reached a sort of leveling-off point. If anyone knows the answer to this, that would be amazing. Until then I will be searching other options, possibly downloading some special libraries or something... Anything to get it to work!

No comments:

Post a Comment