Four different methods exist for adding components to a project.
ato create part
CLI tool fetches a part and adds the pinout, footprint, and 3D model to your project.
C7426
)NE5532DR
)C7426
and press enter.
ato create component search
Enter
through the default options.
component
component
keyword tells the compiler that a new component class is being specified, which is a subclass of module
.
The has_part_picked
trait tells the compiler it can pick that JLCPCB part to fill this spot.
The manufacturer
and mpn
attributes together fully specify which component this is as well.
If you’re making a component class for a specific component, it’s typically a good idea to include at least either the lcsc_id
or the mpn
+ manufacturer
.
The is_atomic_part
trait tells the compiler that this component represents a physical part that can be placed on a PCB. The trait takes several important attributes including the manufacturer and partnumber (MPN) of the part, along with the KiCad footprint and symbol files and 3D model (STEP) file to use for rendering the part.
The datasheet_url
and designator_prefix
attributes are optional, but it’s a good idea to include them. They’re self-explanatory.
pin
pin
keyword to define electrical interfaces, which the compiler maps to pads on the footprint.
That is, pin 2
says:
2
(the compiler treats pins as a special-case where they may have an integer name)ato create part
, you can manually add components to your parts directory.
project/parts/
named the same as your component.LDO
), import and subclass that abstract class to get its generic methods and attributes.
For example, you should update the component class like this:
mpn
and manufacturer
from ato create component
mpn
and manufacturer
are only interpreted properly if they exactly match a component in the database.