motor shield and optoisolator

I have got a school project, I am cabable in the electronics but lag in the department of programming.

I am using the motorshield from this site: http://www.ladyada.net/make/mshield/index.html

I have to set up two dc-motors runing at a speed not very hard have got it working with setting up the speed. next problem is that I need to reed the actually length it would go when set up with a geraing system, I am to use the optoisolator to do that. I am not sure as to how I would get the inputs in the arduino and how to make those readings tell me howlong I have gotten or how fast I am going.

I am using the libaries from the site to, cause I seem to bee a newbee too this when it comes to programming and have only manage to get the motor running by including the files it sugested, that would be motor.h. though I do not know what is happenin with half of the stuff written in it.

so I would like a little simpler solution on how to make the motor running and how to get the inputs from the optoisolator making me get som data on speed and length I would travel with a specific gearing.

I am to use the optoisolator to do that.

An optical encoder, maybe. Not an optoisolator.

well it is also called an optocoupler but it is what I am suposed to use :) an electronic device designed to transfer electrical signals by utilizing light waves to provide coupling with electrical isolation between its input and output, I am to read how often this happens and by that I can read how a wheel turn.

for speed and distance, you want an opto-encoder not an opto-coupler

An opto-encoder is also called a rotary encoder, and an opto-coupler is also called an opto-isolator.

Google "arduino rotary encoder". It'll definitely steer you in the right direction. There are plenty of tutorials for rotary encoders and arduino. Here's one: http://www.hobbytronics.co.uk/arduino-tutorial6-rotary-encoder

an electronic device designed to transfer electrical signals by utilizing light waves to provide coupling with electrical isolation between its input and output

So, what will it's input be? Reading the output is trivial.

well for my purpose both can be used cause it is just a matter of reading when there is a link in the signal. and then knowing how many signals it takes to get a full turn on the wheel.

well I only need to know when there is a connection between the two then I can count how many times that happens and by thet I can know how much the wheel have turned.