Controlling DC motor speed with codes

Helle there,
i am making a project with a dc motor
i want to control the speed of the dc motor with codes is that possible??

Yes.

And if you give us a few more details about your project and your DC motor and the codes we could provide more detailed help.

Steve

In principle, you could replace the led in this tutorial sketch with the gate of the transistor in the following diagram. Exact details of the transistor will depend on the details of the motor.

The above will cater for speed control; if you need to be able control the direction, you need some way to change the polarity which the above can't do. Then you would need a driver such as one of these.

OskarStaal:
Helle there,
i am making a project with a dc motor
i want to control the speed of the dc motor with codes is that possible??

What precisely do you mean by "control the speed"? roughly? exactly? to 1% accuracy?
Do you want the speed to stay the same as the load varies?