Pulse width modulation

Pulse width modulation

Using pulse width modulation in electronics, controlling motor speed, lighting power, etc.

Creating your own DC motor control library

Creating your own DC motor control library

Article-series: Arduino, using DC motors #4

We have developed a class that can manage a DC motor, but if we intend to use it in multiple projects, we will have to duplicate the same code for each project. To avoid this, it would be wise to extract all the repetitive code and place it in a separate library. This library will then be connected to the project in the same way as the standard Arduino libraries.

Connect a DC motor. Microcircuit L298P

Connect a DC motor. Microcircuit L298P

Article-series: Programming Arduino from scratch #7

Article-series: Arduino, using DC motors #1

Consider the option of connecting a conventional DC motor to the controller, which can be used, for example, to move the robot or perform useful work. To do this, we will use a motor controller based on the common L298P microcircuit.

Creating a class for working with DC motor

Creating a class for working with DC motor

Article-series: Arduino, using DC motors #3

One controller can control multiple DC motors. Since the control code will be the same, that is, allocate a separate class for it. Then, when adding a new engine, it will be enough to add just a few lines, and not copy the same functions and variables for each.