Will dc motors work in servo library?

I was just wondering if you could use the servo motor library to run dc motors. Since it is possible to run continous rotation servo using the servo library, could you use a dc motor instead of a continous rotation servo? Will it work?

I have code that will move a continous rotation servo left, right, forward, and backward. If I use a dc motor instead of the servo, will the motor spin, and will it spin faster?

Well for a start a dc motor has only 2 wires, so there's nowhere to insert the signal.

The electronics of a servo interpret that signal, and converts the pulse into action. There's no such electronics in a dc motor.

What I mean is wire the motors to the arduino the same way, except use code that would move a continous rotation servo. Since servos and motors both use one pin, could it work?

Not sure what you mean by motors using only one pin.

But there's no electronics in a dc motor to interpret the pulse that is sent to servo.

Look at the servo signal here

If you were to take those pulses and put some current oomph into them (i.e. transistor driver), you could drive a motor, tho likely with poor performance.
You'd only see one speed, with a slight variation in speed from -90 to +90 position, and the motor would likely stop pretty easily with much load put on it at -90 up to some thing higher because the on-time of the pulse is so small.

If you were to drive the motor (thru transistor drive again) with inverter signal, then you'd see full speed at -90, and slower at the +90 pulses.

If the motor is generally the same size/voltage as the motor in the servo, you might make a direct substitution. If the motor is large or of a different voltage you can use the servo internal circuitry to drive an H-bridge that controls the motor.

aryakeyvan:
I was just wondering if you could use the servo motor library to run dc motors. Since it is possible to run continous rotation servo using the servo library, could you use a dc motor instead of a continous rotation servo? Will it work?

No, in short.

I have code that will move a continous rotation servo left, right, forward, and backward. If I use a dc motor instead of the servo, will the motor spin, and will it spin faster?

You drive a motor with a motor driver. A servo contains a motor driver of its own and a feedback
loop.