MustafaMulla29/bluetooth-connected-pedometer

It defines a PCB footprint and schematic symbol for a row of solder pads used as wire connection points, featuring customizable spacing and label annotations.

Version
0.3.0
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone MustafaMulla29/bluetooth-connected-pedometer  # download the package files into ./bluetooth-connected-pedometer
tsci add MustafaMulla29/bluetooth-connected-pedometer    # add it to your project as @tsci/MustafaMulla29.bluetooth-connected-pedometer

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

WirePads.tsx

import { Fragment } from "react"
import type { CommonLayoutProps } from "tscircuit"

// Wire soldering lands, not an interchangeable commercial connector footprint.
export function WirePads({
  name,
  labels,
  pitch = 2,
  ...props
}: CommonLayoutProps & {
  name: string
  labels: string[]
  pitch?: number
  schSectionName?: string
}) {
  return (
    <chip
      name={name}
      pinLabels={Object.fromEntries(labels.map((s, i) => [`pin${i + 1}`, s]))}
      schPinArrangement={{
        rightSide: { pins: labels, direction: "top-to-bottom" },
      }}
      schWidth={1.4}
      schHeight={labels.length * 0.2 + 0.2}
      footprint={
        <footprint insertionDirection="from_above">
          {labels.map((s, i) => (
            <Fragment key={s}>
              <smtpad
                solderMaskMargin={0.025}
                portHints={[`pin${i + 1}`]}
                shape="rect"
                width={1.2}
                height={1.8}
                pcbX={(i - (labels.length - 1) / 2) * pitch}
                pcbY={0}
              />
            </Fragment>
          ))}
          <silkscreenrect
            strokeWidth={0.15}
            width={(labels.length - 1) * pitch + 1.8}
            height={2.4}
          />
        </footprint>
      }
      {...props}
    />
  )
}