Skip to content

Instantly share code, notes, and snippets.

@seveibar
Last active September 4, 2024 03:09
Show Gist options
  • Save seveibar/dd44627826b600f62f41e71aedfdda76 to your computer and use it in GitHub Desktop.
Save seveibar/dd44627826b600f62f41e71aedfdda76 to your computer and use it in GitHub Desktop.
import { Circuit } from "@tscircuit/core"
const circuit = new Circuit()
circuit.add(
<board width="12mm" height="10mm">
<chip
name="U1"
footprint="soic8"
pinLabels={{ pin1: "PWR", pin8: "GND" }}
/>
<resistor
name="R1"
footprint="0402"
resistance="10k"
pullupFor=".U1 port.2"
pullupTo="net.5v"
pcbX={-4}
pcbY={0}
pcbRotation={-90}
/>
<capacitor
name="C1"
capacitance="10uF"
footprint="0603"
decouplingFor=".U1 port.PWR"
decouplingTo="net.gnd"
pcbX={4}
pcbY={0}
pcbRotation={-90}
/>
<jumper pcbX={0} pcbY={-4} name="J1" footprint="pinrow4" />
<trace from=".U1 .PWR" to="net.5v" />
<trace from=".U1 .GND" to="net.gnd" />
<trace from=".J1 pin.1" to="net.5v" />
<trace from=".J1 pin.2" to=".U1 port.2" />
<trace from=".J1 pin.3" to=".U1 port.3" />
<trace from=".J1 pin.4" to="net.gnd" />
<tracehint for=".C1 pin.1" offset={{ x: -2, y: 3 }} />
</board>,
)
circuit.render()
circuit.getSvg({ view: "pcb" })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment