![]() The first two lines of code assign the in1 variable to Arudino pin 10, and the in2 variable to pin 11. Once you’ve built the circuit above, upload this code to your Arduino: int in1 = 10 Here, we’re using a 12V supply to power the motor, and a separate 5V supply to power the Arduino and L293D. You will probably need a separate power supply for the motor. To build this project, connect the DC motor, L293D, and Arduino like this: You’ll learn basic to advanced Arduino programming and circuit building techniques that will prepare you to build any project. If you want to learn more about the Arduino, check out our Ultimate Guide to the Arduino video course. Let’s build an example project that will make a DC motor spin in one direction for two seconds, stop, then spin in the opposite direction for two seconds. To build the example projects, you’ll need the following parts:Ĭonnect the DC Motor and L293D to the Arduino In this tutorial, we’re going to build a few example projects to demonstrate how to use the L293D to control DC motors on the Arduino. To turn the motor OFF, send a LOW signal to the input 2 pin. To make the motor spin in the opposite direction, send a LOW signal to the input 1 pin, and a HIGH signal to the input 2 pin. This will cause the motor to spin in one direction. To turn the H-bridge 1 motor ON, send a HIGH signal to the input 1 pin, and LOW signal to the input 2 pin. Input 4: motor control signal for H-bridge 2.Input 3: motor control signal for H-bridge 2.Input 2: motor control signal for H-bridge 1. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |