![]() ![]() The code is quite simple and it does not require any external library to work. We are using 9V battery and the jumper is in place, so we can use +5V pin to power the Arduino too. Having a solid understanding of each pin and how the module works we can proceed with the wiring.ĮNA and ENB are connected to the Arduino Nano PWM pins and IN1/IN2/IN3/IN4 to common digital pins. With 12V power supply the motors will receive approximately 10V which means that we won't be able to get the maximum speed. Take into consideration that the L298N module has voltage drop of approximately 2V. Without jumper: the regulator is disabled and +5V pin acts as input, expecting 5V to be supplied. Note: with power supply greater than 12V the jumper must be removed to prevent damage to the onboard regulator. It can be used to power an Arduino or other circuitry that needs 5V power. With jumper: the regulator is enabled and +5V pin acts as output. The module includes 5V regulator that can be enabled/disabled using a jumper: Otherwise the motor will always spin at full speed. If you want to keep the speed control of your motors remove the jumper and connect ENA and/or ENB pins to PWM. Usually the module comes with a jumper on these pins that connects them directly to HIGH value. ![]() That means that motor will spin at full speed with HIGH and stop with LOW. The speed control pins ENA and ENB are used to turn on/off the motors and control their speed with Pulse Width Modulation (PWM). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |