Rotary Encoder

I have created a rotary encoder using a slotted ir switch and an encoder wheel with 60 cut outs. I was wondering what the conventional way of driving a simple two wheeled robot in a straight line would be using the encoder information.

ie. should I drive both motors forward for a certain amount of time and then check the encoder pulses and correct accordingly. Or should I drive each motor alternately forward one pulse at a time?

Any information would be much appreciated.

Thanks in advance

If you want speed, you'd compare encoder readings while the robot is moving, and adjust the speed of one of the motors while it is moving.

Keep in mind, though, that if the encoders are attached to the drive axles, all you will be able to ensure is that the two axles are turning at the same speed.

Driving two axles at the same speed is no guarantee that the robot will then move in a straight line.