0

RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298 w/
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298 w/

by silver2row on Wed May 02, 2018 12:19 am

Hello,

Here is the schematic of the board: https://lh3.googleusercontent.com/-rNBT ... ForBBB.PNG

Here is the software: https://pastebin.com/ciQEB9Je

Here is the set up:

    P9_21 as GPIO to LN1

    P9_22 as GPIO to LN4

I bought it from here: https://store.open-electronics.org

Here is the software in case the pastebin paste is out of date:

Code: Select all | TOGGLE FULL SIZE
import Adafruit_BBIO.GPIO as GPIO
import time

GPIO.setup("P9_21", GPIO.OUT)
GPIO.setup("P9_22", GPIO.OUT)

m1a = GPIO.output("P9_21", GPIO.HIGH)
m1b = GPIO.output("P9_22", GPIO.HIGH)

while (True):

        try:
                for motor in range (0, 101, 1): #starts at 0, steps up to 101 in 1 steps
                    m1a = ("P9_21")
                    time.sleep(3)
                    print(motor)
                for motor in range (100, -1, -1):
                    m1b = ("P9_22")
                    time.sleep(3)
                    print(motor)

        except(KeyboardInterrupt):

                #And final cleanup
                print "You have just ended your camp trip!"
                GPIO.cleanup()
                quit()




Everything is grounded and secure. If you know of what could be going on that prevents motors from running, please let me know. The BBB is tested and working.

I use sudo config-pin P9.21 gpio and sudo config-pin P9.22 gpio as my set up for pin labels.

Seth

P.S. Please reply or let me know what you think.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298

by silver2row on Wed May 02, 2018 12:22 am

Hello Again,

If there is some testing that I have overlooked, please reply to let me know of what you think I should do. The light on the motor driver turns on when I press it after applying power via 12v 3.3Ah and I tried another battery. This other battery was a 12v 1.3Ah.

Seth

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298

by silver2row on Wed May 02, 2018 3:40 pm

Hello,

Code: Select all | TOGGLE FULL SIZE
import Adafruit_BBIO.GPIO as GPIO
import time

GPIO.setup("P9_21", GPIO.OUT)
GPIO.setup("P9_22", GPIO.OUT)
GPIO.setup("P9_12", GPIO.OUT)
GPIO.setup("P9_15", GPIO.OUT)

m1a = GPIO.output("P9_21", GPIO.HIGH)
m1a = GPIO.output("P9_22", GPIO.HIGH)
m1b = GPIO.output("P9_13", GPIO.HIGH)
m1b = GPIO.output("P9_15", GPIO.HIGH)

while (True):

        try:
                for motor in range (0, 101, 1): #starts at 0, steps up to 101 in 1 steps
                    m1a = ("P9_21")
                    time.sleep(3)
                    print(motor)
                for motor in range (0, 101, 1):
                    m1a = ("P9_22")
                    time.sleep(3)
                    print(motor)
                for motor in range (100, -1, -1):
                    m1b = ("P9_13")
                    time.sleep(3)
                    print(motor)
                for motor in range (100, -1, -1):
                    m1b = ("P9_15")
                    time.sleep(3)
                    print(motor)

        except(KeyboardInterrupt):

                #And final cleanup
                print "You have just ended your camp trip!"
                GPIO.cleanup()
                quit()


This is some new software I was trying.

...

I see my GPIO pin at P9_13 is not set up as 1. It is set up in the direction of 0. Are there any tutorials on this issue? I get an error and I want to change the direction of my P9_13, GPIO pin to 1 and not 0.

Seth

P.S. If you have any ideas on what I am saying, please contact me. Oh...and this is the error:

File "motors.py", line 11, in <module>
m1b = GPIO.output("P9_13", GPIO.HIGH)
RuntimeError: The GPIO channel has not been setup() as an OUTPUT

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298

by drewfustini on Thu May 03, 2018 12:00 am

It looks like you are missing:
GPIO.setup("P9_13", GPIO.OUT)

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298

by silver2row on Thu May 03, 2018 12:15 am

Hello,

I put P9_12 instead. Oops!

Seth

P.S. yikes!

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298

by silver2row on Fri May 04, 2018 9:15 pm

Mr. Drew,

Hello there. Seth here. I am dealing w/ this fellow on the BBB.io/forum chat (thing). He says that the L298 board most likely needs a pause, shutdown, and then go HIGH w/ Adafruit_BBIO.GPIO as GPIO w/ the GPIO pins I am using.

I changed the software some and getting no feedback from my motors.

Look...this is not your issue or anyone else's issue on this board. I just want to work w/ someone who may use the L298 as I am using it now. I have some other motor drivers but I am trying to "master" this one for now.

Seth

P.S. I am using P9.21 and P9.22 as GPIO to EnA and EnB on the L298. I have the grounded pin from the BBB to the GND pin on the L298 board. Wait...I have a photo of the board in case someone is using it. Please see below.
Attachments
L298II.PNG
This is it. The Board!
L298II.PNG (809.78 KiB) Viewed 686 times

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298

by silver2row on Sat May 05, 2018 2:52 pm

Hello,

I talked w/ a fellow on IRC, Freenode at #beagle last night. He directed me on specific software to run to make a motor turn and stop. I am not sure if he wants me to brag about him, his help, or his name but here goes it:

zmatt: Thank you.

Seth

P.S. Now that I have one motor moving and some basic software to test, I can now provide other sources of software to promote the inevitable motion of my motors w/ the L298 board. If you get bored, let me know how you are doing w/ your L298 board w/ the BBB.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Hello and Messing w/ the BBB/Adafruit_BBIO.GPIO/L298

by silver2row on Mon May 07, 2018 1:30 am

Hello,

Open-Electronics.org sold me this nice L298 motor driver. So, I decided to learn about it and try to build some software around it. I came up w/ some ideas and got some help. See here:

Code: Select all | TOGGLE FULL SIZE
#!/usr/bin/python
   
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()


This software will make one motor start and initialize, move forward, move backward, and then cease. Once it ceases, the software ends and the terminal is free to use.

Seth

P.S. If you are using the L298 motor driver, please reply and maybe we can work towards communication on this subject. Heh?

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Please be positive and constructive with your questions and comments.