
I hope you have read the previous tutorial How to Create a GUI in Raspberry Pi 3 as we are gonna create a small GUI in this tutorial as well and then we are gonna control our DC Motor with Buttons on GUI. We will control both speed and direction of DC Motor. In today’s tutorial, I am going to show you How to Control DC Motor with Raspberry Pi 3. Unfortunately I can't seem to figure out how to attach a local image to this message.Hello friends, I hope you all are doing great. Maybe something is obvious to you guys more experienced There are a couple of pins where I wonder if I have contact but I don't recognize any bridging. I took a couple of pictures of the soldering. Could I have a bridge between 2 pins? (Multiple access on port?) Now I soldered the DRV8833 board myself and it was my first time soldering. Almost immediately after the motor initiates movement the programs stops and gives me the following error.Ĭonnection lost (read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)) The programs starts and the motor begins to move.

I tried to replicate this demo and I've had partial success. Hello, first I am relatively new to micro controllers / micropython so apologies in advance if I'm asking the obvious. The motor will rotate in both directions five times. Save the code to the Raspberry Pi Pico as motor.py and click on the green arrow to run the code. Create a for loop which will run the test function five times. Create a final “test” function that will call the previous functions and run a test sequence that will spin the motor “forward” for two seconds, then “backward” for two seconds. By pulling both pins low, we tell the motor controller to stop all movement of the motor. Create a function to move “backward.” This sees the GPIO pin states reverse, causing the motor to spin in the opposite direction.

This, in turn, communicates our intended direction to the motor controller and the corresponding output pins will follow suit forcing the motor to move in a set direction.

To do this we need to tell one pin to pull high, the other low. Create a function to move the motor “forward”.
