bb12jo
Posts: 62
Joined: Tue May 27, 2014 10:16 pm

How to program for a breadboard?

Thu Jun 19, 2014 10:33 pm

Hi!
I have 4 motors I need to hook up to the Pi but my motors require four GPIO pins each so since there are 8 on the Pi, I can't have more then 2 motors attached. I use this http://www.amazon.com/gp/product/B00CAG ... UTF8&psc=1 for the motor controller. I bought a breadboard and a connector to connect the board to the Pi, but my problem is how do I code for it? Basically what do I call the pins on the BreadBoard so python will understand?

The connector... http://www.ebay.com/itm/161233322842?ss ... 1439.l2649

The breadboard... http://www.ebay.com/itm/400366982418?ss ... 1439.l2649

Thanks so much in advance!

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to program for a breadboard?

Thu Jun 19, 2014 10:41 pm

Motor drivers generally need two gpios per DC motor. Why do you think you need 4?

There are at least 17 usable gpios on the Pi, not 8.

bb12jo
Posts: 62
Joined: Tue May 27, 2014 10:16 pm

Re: How to program for a breadboard?

Thu Jun 19, 2014 11:01 pm

I thought I could only use the green ones...http://www.hobbytronics.co.uk/image/dat ... pinout.jpg
Also look at my motor controller as it has 4 wires going towards the Pi. IIRC there is 2 for enable and 2 for on and off.
Thanks,

riklaunim
Posts: 265
Joined: Tue Apr 22, 2014 7:34 pm

Re: How to program for a breadboard?

Thu Jun 19, 2014 11:18 pm

Check this video: [Mod Removed link - video wrong] it covers your controller.

bb12jo
Posts: 62
Joined: Tue May 27, 2014 10:16 pm

Re: How to program for a breadboard?

Fri Jun 20, 2014 12:12 am

Anyways, my original question was how to code for a breadboard? What do I need to import and what do I call the pins? Though I am curious on what pins I can use to control motors besides the green ones. Thanks for your help!!

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: How to program for a breadboard?

Fri Jun 20, 2014 12:20 am

Hi,
bb12jo wrote:Anyways, my original question was how to code for a breadboard?
Breadboard is something very similar to a large connector... therefore nothing but a bunch of metal and plastics, which cannot be programmed.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13100
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How to program for a breadboard?

Fri Jun 20, 2014 12:30 am

As Ivan said a breadboard is just a bunch of connectors, without any predefined meaning, you certainly cannot "program for it".
That is, unless you use something like adafruits "PI Cobbler", (See picture below) then for the remaining rows of 4 connected holes the cobbler clearly marks it's meaning, and then you can use the notation used in the various libraries belonging to the programming language you are using. But it's also possible to use single "fly wires" (AKA Dupont Wires), and use them to connect a random GPIO header pin to a random breadboard hole (or whatever you want to connect it to), there are hundreds of other possibilities than using breadboards.
Image

bb12jo
Posts: 62
Joined: Tue May 27, 2014 10:16 pm

Re: How to program for a breadboard?

Fri Jun 20, 2014 12:49 am

As I said in my first post, I have one of those connectors but I don't know if I call it A1 instead of GPIO 12 to program the breadboard.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13100
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How to program for a breadboard?

Fri Jun 20, 2014 12:59 am

No software would/could address breadboard locations, if not for the simple reason that you can plug your Chinese clone adapter in any breadboard location. All libraries always only address GPIO header locations, which are unchangeable (except that there are two as older revision 1 PI's have a few changes) never "breadboard locations".

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: How to program for a breadboard?

Fri Jun 20, 2014 1:02 am

Hi,
bb12jo wrote:As I said in my first post, I have one of those connectors but I don't know if I call it A1 instead of GPIO 12 to program the breadboard.
You're unbeatable... ;-)

RasPi is not aware of breadboard and doesn't know what A1 stands for.

In order to make your coding easier, you can define mapping by yourself. If you connect together GPIO 12 and A1 with a wire, then you define (depends on language used, but try to understand the principle): #define A1 GPIO.12. This would be understood by the code as "wherever I write A1, I actually mean GPIO 12".
Later on, you can use in your code A1, which will be automatically translated to GPIO.12 and becomes understandable to RasPi...


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

bb12jo
Posts: 62
Joined: Tue May 27, 2014 10:16 pm

Re: How to program for a breadboard?

Fri Jun 20, 2014 1:52 am

Hi!
I have just tried connecting a jumper wire to the breadboard and then connecting one of wires to the same row and it works, though I still have the same problem of when only one motor seems to run at full speed while the other doesn't really run at all. If anyone knows of a fix, please tell me.
Thanks a bunch!

User avatar
Cancelor
Posts: 776
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: How to program for a breadboard?

Fri Jun 20, 2014 8:16 am

Here is an alternate view of the GPIO header.
GPIO.jpg
GPIO.jpg (45.58 KiB) Viewed 2510 times
The motor controller will drive two motors each :D .... it is a 'Dual H-Bridge Motor Driver' However it a a 5v board and the GPIO pins are only 3.3v (3v3) :(

A breadboard is NOT programmable. You just plug things into it. Each block of 5 holes are connected together inside the breadboard. e.g. a3,b3,c3,d3 and e3. or g8,h8,i8 and j8 The blue and red holes down each side are used for power and ground. :idea: (looks like there is a break at row 30). Your GPIO Extension Board connects to these so be very careful to make sure you know what voltage is on each side. I do not know this type of GPIO Extension Board so I can't help you with that ... unless you can post some very close up pictures of it.

It looks like P1 goes into f4 so anything plugged into g4,h4,i4 or j4 will be conected to it. :P (edit .. I might be one row out)

Follow the tutorial that riklaunim posted [Mod Removed link - video wrong]
Last edited by Cancelor on Fri Jun 20, 2014 9:26 am, edited 1 time in total.
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

User avatar
Cancelor
Posts: 776
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: How to program for a breadboard?

Fri Jun 20, 2014 8:26 am

Here is another more complete view of the GPIO header from http://wiringpi.com/pins/
WiringPi.jpg
WiringPi.jpg (60.61 KiB) Viewed 2505 times
I think your P1 will be the same as GPIO1 which is presented on pin 12 of the GPIO header.

P3 is GPIO3 and is pin 15 on the GPIO header.
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

bb12jo
Posts: 62
Joined: Tue May 27, 2014 10:16 pm

Re: How to program for a breadboard?

Fri Jun 20, 2014 2:25 pm

So I can only use the green GPIO pins for the H bridge?

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: How to program for a breadboard?

Fri Jun 20, 2014 2:33 pm

Hi,
bb12jo wrote:So I can only use the green GPIO pins for the H bridge?
Other signals (cyan, blue, yellow) can also be used. They have some additional capabilities (as a result, their name is not GPIOx), but can also be equally used to control the H bridge.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to program for a breadboard?

Fri Jun 20, 2014 2:34 pm

bb12jo wrote:So I can only use the green GPIO pins for the H bridge?
You can use any of the 17 gpios on P1 to control your motor driver board. The green ones don't have useful alternate functions so they are a good choice.

If you follow the linked youtube tutorial you will likely damage your Pi. Your Pi, your choice.

bb12jo
Posts: 62
Joined: Tue May 27, 2014 10:16 pm

Re: How to program for a breadboard?

Fri Jun 20, 2014 2:37 pm

So I can use all the pins that aren't ground or power and it would work and be safe?
Thanks a bunch!

Return to “Python”