Hello...
I am going to add the second motor soon. Enjoy...
Seth
This is a L298 motor driver from Open-Electronics.org and a BeagleBone Black w/ Python software using Adafruit_BBIO.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Hello...
I am going to add the second motor soon. Enjoy...
Seth
L298motorsII.pygetting some help from #beagle at Freenode IRC...plain - 591.00 bytes - 05/07/2018 at 03:18 |
|
|
L298_schematic.PNGschematic of this particular board...Portable Network Graphics (PNG) - 308.06 kB - 05/07/2018 at 03:15 |
|
|
master_pin.pyinitial software...get started. This should start and stop the motor(s). I may have made a mistake. It may not revolve in reverse. I will update it in time.plain - 369.00 bytes - 05/07/2018 at 03:14 |
|
Attach the wiring from the BBB while it is unplugged and there is no power going to the BBB to the L298 motor driver from Open-Electronics.org.
One of the four wires controls the on/off functionality (En A or En B). Then, the other wires, one ground, control forward and backwards capabilities. Attach your other wiring, the wiring for forward/backward, to ln1 and ln2. The En B and ln 3 and ln 4 are for the second motor.
Go to beagleboard.org/latest-images. Grab your image, i.e. preferably the newest available. If your pins are configured for other uses outside of GPIO functionality, use config-pin gpio for each pin that is used.
If you are having trouble w/ config-pin and you need support, try to use sudo or see here: https://github.com/adafruit/adafruit-beaglebone-io-python.
There is a small section on config-pin on this GitHub.com page.
So, that connection w/ this software will get you up and running quickly:
import Adafruit_BBIO.GPIO as GPIO
import time
Master_Pin = "P9_21"
ln1 = "P9_22"
ln2 = "P9_12"
if __name__=="__main__":
GPIO.setup(Master_Pin, GPIO.OUT)
GPIO.output(Master_Pin, GPIO.LOW)
GPIO.output(Master_Pin, GPIO.HIGH)
time.sleep(5)
GPIO.output(Master_Pin, GPIO.LOW)
GPIO.output(Master_Pin, GPIO.LOW)
GPIO.cleanup()
If this software only goes forward, stops, and shuts down, let me know. If that is too boring, look below. This software will control initialize, start forward, stop, reverse, and stop, and then shuts down and closes the software as it completes.
import Adafruit_BBIO.GPIO as GPIO
import time
Master_Pin = "P9_21"
ln1 = "P9_22"
ln2 = "P9_12"
if __name__=="__main__":
GPIO.setup(Master_Pin, GPIO.OUT)
GPIO.output(Master_Pin, GPIO.LOW)
GPIO.setup(ln1, GPIO.OUT)
GPIO.setup(ln2, GPIO.OUT)
GPIO.output(Master_Pin, GPIO.HIGH)
GPIO.output(ln1, GPIO.HIGH)
GPIO.output(ln2, GPIO.LOW)
time.sleep(15)
GPIO.output(Master_Pin, GPIO.HIGH)
GPIO.output(ln1, GPIO.LOW)
GPIO.output(ln2, GPIO.HIGH)
time.sleep(15)
print "I love your body Larry!"
GPIO.output(Master_Pin, GPIO.LOW)
GPIO.output(Master_Pin, GPIO.LOW)
GPIO.cleanup()
If you are wondering about the schematic of this particular motor driver, see the photos section or see here now:
See the L298N, dual H-bridge section for pin connections that need to be made.
Seth
P.S. Use a 12v battery if available. The motors can handle 2A maximum each forward and backwards. The L298 board can handle 5 to 30V DC.
Create an account to leave a comment. Already have an account? Log In.
I created this project to get people interested in motors and to promote collaboration on this subject.
Seth
Become a member to follow this project and never miss any updates
Hello Again,
I am working on a schematic on KiCad w/ the BBB and this L298 motor driver for ideas.
Seth