New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to code a new part and footprint? #135
Comments
"How do I ...?" questions usually get more exposure if they're posted in the discussions. As an example, I created a SKiDL module for a PMOD plug here. You could also do it like this: class mx(Part):
def __init__(self, *args, **kwargs):
Part.__init__(self, name="MX_SWITCH", tool=SKIDL, ref_prefix="SW", footprint="<something>", **kwargs)
self += Pin(num=1, name='pr')
self += Pin(num=2, name='pc')
... After defining the
Is there a reason why each of your pins was assigned pin number 1? |
'pin number 1'....Hmm not sure how I determined that...I took it out.
Do you have an example of a Python defined footprint? Or is that still
external and we're still tied to importing existing footprints from
another source? Are the footprints organic to kicad, in general?
Thanks for the reply - if I can get this working I'll definitely share in
the discussions and elsewhere!
…On Mon, Oct 4, 2021 at 3:35 PM Dave Vandenbout ***@***.***> wrote:
"How do I ...?" questions usually get more exposure if they're posted in
the discussions <https://github.com/xesscorp/skidl/discussions>.
As an example, I created a SKiDL module for a PMOD plug here
<https://devbisme.github.io/circuitsascode/api/html/_modules/circuitsascode/interfaces/pmod.html#pmod_plug_12>
.
You could also do it like this:
class mx(Part):
def __init__(self, *args, **kwargs):
Part.__init__(self, name="MX_SWITCH", tool=SKIDL, ref_prefix="SW", footprint="<something>", **kwargs)
self += Pin(num=1, name='pr')
self += Pin(num=2, name='pc')
...
After defining the mx class, you can instantiate it like so:
mx_a = mx()
Is there a reason why each of your pins was assigned pin number 1?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#135 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRPRYWNLSXL2GJD2XY6D2DUFH6ZHANCNFSM5FJ77XCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
SKiDL doesn't have any features for defining footprints. Right now, all footprints are fetched from KiCad. The |
I'm wanting to create a simple pcb containing a very simple part - a cherry mx switch, which has only two pins (and some mounting holes). I'm mucking around with custom kicad libraries/modules and trying to search from within those since the basic kicad library doesn't seem to include it, but I'm also interested in defining the part by just using skidl and bypassing the need for kicad entirely.
Just messing around, I try to make a child class of Part:
Is this the right approach? I'm already getting errors trying to instantiate it (needs "fields") and I know I'll have to define the footprint somehow.
The text was updated successfully, but these errors were encountered: