I bought my first Arduino today, six servos and my first single servo sweep worked! Arduino is fun.
I want to translate an image file to movement. The idea is to take an B/W image with height=6 (for six servos). I later want to generate servo movement according to the image (white=servo position "1", black=servo position "2"). To control the movement speed there has to be a timing variable wich needs to be set through a potentiometer. I am just starting to wire up all the servos right now.
I would like to know your ideas on how to
read the image (SD Card?)
scan the image column per column
take this as input for the servo moving routine
move the servos.
If you have an idea for any of those steps, please just let me know !
There doesn't really seem to be any place else to read it from.
scan the image column per column
That would depend on the image format you are using, currently unspecified, and whether the data is stored row by row or column by column.
take this as input for the servo moving routine
A black and white image will contain black and white. What do you want the servo to do when the value is black? When the value is white?
A grayscale image would be a better choice, I think.
move the servos.
Now, seriously, if you can't even figure out how to move a servo, you are in way over your head. 5 minutes looking at the examples should be enough for you to figure this out.
I bought my first Arduino today, six servos and my first single servo sweep worked! Arduino is fun.
Oh, wait. You already know how to move a servo, so why are you asking?
zoomkat:
Don't think I've seen any examples of an arduino doing image processing.
Seems a curious way of defining servo positions. If the OP only has two positions for each servo, a text file containing lines of ones and twos (or A/B, L/R, etc) seems easier to me.
Seems a curious way of defining servo positions. If the OP only has two positions for each servo, a text file containing lines of ones and twos (or A/B, L/R, etc) seems easier to me.
Although the OP didn't say it, I suspect the OP assumes the image file is being updated somehow and the servos will respond to the changes, aka the part the arduino may not be able to accomplish easily.
The servo movement will be prefconfigured for each run. There will only be two positions for each servo to be in - so a matrix (with n (= number of servos) x l(=number of steps)) will do just fine. As there will be an artistic side to the project I thought it being easy to create the movement patterns with an image editor, load that file up and let the arduino step through the file and read the positions from that.
Anyway, it would be easy to produce a textfile matrix out of an image so maybe I start with a textfile as input for the servo movement.
There is currently no need for on-the-run updating of that image file (but cool idea zoomkat!). And there is no need for image processing, it's more image analysis (as said above the image is just a matrix to hold the servo positions).
Currently I have the arduino and 6 servos connected and am amble to move them all. I will now look into the "loading" of the input file.