Skip to content. | Skip to navigation

Personal tools

BreadboardGenerator – PDK Tool

The BreadboardGenerator.py is a python script as tool to quickly generate all xml code for a breadboard part

Breadboard photo


An example of a breadboard.

Usage

This script outputs the xml code for the partdescription.xml. That means if you run it in the command line, like this:

    % cd FrizingPDK/Tools/BreadboardGenerator
% python generator.py run

it will just spit out a bunch of xml into your window. You can copy and paste it from there, but it’s more convenient to send the output of the command to a file directly. In Unix terms this is called redirecting:

    % python generator.py run > partdescription.xml

This will create the file partdescription.xml in the same location as where you are running the script from.

This is still not very useful to run the script like this, because it is generating the xml code for the standard breadboard, which already is in your Fritzing library. This tool becomes especially useful if you want to create your own no-so-standard breadboard.

The way to use this tool is to modify it. Open the generator.py in your favorite code editor and change the variables. Most useful variables to play with can be found in the setup() method, right below

   41  def setup():
42 # Edit these variables below to generate different breadboards
43 #

There you can find amongst others, the following variables (and properties of the rowProps and lineProps dict):

   54      # Rows 
55 rowHeight = 5
56 rowsInterBlockSpacing = 2
57 rowProps['startsAtXWithNumber'] = -1
58 rowProps['startsAtYWithLetter'] = 'a'
59 rowProps['segmentLength'] = 64
60 rowProps['interSegmentSpacing'] = 2
61 rowProps['numberOfSegments'] = 1
62
63 # Lines
64 numberOfLinesPerSet = 2
65 interRowsLinesSpacing = 2
66 lineProps['startAtX'] = 2
67 lineProps['subSegmentLength'] = 5
68 lineProps['interSubSegmentSpacing'] = 1
69 lineProps['segmentLength'] = 5 # measured in subSegments
70 lineProps['interSegmentSpacing'] = 2
71 lineProps['numberOfSegments'] = 2
72 lineProps['endsAtYWithLetter'] = 'z'

Those variables and properties define how the breadboard is generated and what kind of breadboard it is. The following diagram shows where those variables and properties apply on the breadboard and how to measure them.

Breadboard measurement diagram

a diagram of all the variables and properties used in the generation of a breadboard.

We don’t do your design

This script just helps you generating a partdescription.xml file for a breadboard. This script doesn’t generate images for the breadboard. You’ll have to make them yourself with your design tools.


Full Reference

This script generates the partdescription.xml code for a breadboard part folder.

Usage:

Run it in the commandline and pipe the result to a file:

	python generator.py run > partdescription.xml

Arguments:

run
Use this to run the script. Without this argument, this same help text is displayed.

Advanced Usage:

If you want to change the type of breadboard which this script generates (the main reason for this script to be in the Fritzing PDK), you can easily edit the python file. The setup() method defines most of the parameters of the breadboard. Probably changing values here is enough for you to make the exact breadboard you like.

NOTE: this script doesn't generate image files for the breadboard. You'll have to make them yourself with your design tools. This script just helps you creating a consistent partdescription.xml file with all the necessary connections.

Document Actions
© 2007- 2008 University of Applied Sciences Potsdam \ Powered by Plone