Posts

Showing posts from March, 2009

Servo Plus Potentiometer

Image
I had to do one more of these before I took it apart.  Not too long ago I saw a link on Make: regarding using potentiometers and servos . To be honest, I never got around to watching the video. But after the last blog entry I made, adding in the potentiometer didn't seem all that hard. The potentiometer takes 5v on one side, ground on the other. In the middle I hooked to one of the analog pins.  Analog read on the Arduino ranges from 0 to 1023. The servo however took a range of values from 375 to 2400. The leaves me needing to convert from 1023 to 2025. This is a fairly simple ratio, which I originally coded something like this: pulse value = ((potentiometer value * 2025) / 1023) + 375 Using this formula introduced me to an interesting detail that I had not seen for a while. Not since a project I had done for the State of Minnesota. At the time I was working on a project for the Department of Education. I don't recall the specifics, but I had been doing some calculations with l