Skip to main content

add

add <component>

This adds the given component to the current insertion point (component, pin) and moves the insertion point to the next component pin of the added component.

Example:

from std import *

v5v = supply("5V")

at v5v
wire down 100
add R1 = res(10k)
wire down 100
5V12R110k

In the above example, after wire down 100 is executed, the insertion point is at the end of the wire. The add command creates a new res component with value of 10k and connects the wire to pin 1 of res. The insertion point is then moved to the next available pin, in this case, it is pin 2 of the newly created res.

The above example is equivalent to:

from std import *

v5v = supply("5V")

at v5v
wire down 100

to R1 = res(10k) pin 1
at R1 pin 2

wire down 100
5V12R110k

In this case, the res(10k) component needs to be assigned to a variable since it has to be referenced later after the to command.

add <component> pin <pin>

A different pin can also be specified when the component is added. The next insertion point will be the next value.

Example:

from std import *

my_component = create component:
pins: 4

v3v3 = supply("3.3V")
gnd = dgnd()

at v3v3
wire down 100 right 100
add my_component pin 3

wire right 100 down 100
to gnd
3.3V11332244J1GND

If the pin specified is the last pin, the next pin will be very first pin.

Example:

from std import *
my_component = create component:
pins: 4

v3v3 = supply("3.3V")
gnd = dgnd()

at v3v3
wire down 100 right 100
add my_component pin 4 # last pin of component

wire right 100 to gnd # insertion point continues at the first pin
3.3V11332244J1GND