imrishabh18/rp2040-motor-controller

This circuit incorporates a USB-C Power Delivery (PD) interface with a CH224K controller, a WJ500V-5.08-04P motor output connector, multiple power conditioning components including capacitors, resistors, diodes, and an RP2040 microcontroller, to manage motor control, signal routing, and power management for a USB-powered stepper motor system.

Version
1.0.14
License
unset
Stars
0

scripts/render-pcb.ts

import { readFileSync, writeFileSync } from "node:fs";
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg";
import { Resvg } from "@resvg/resvg-js";
const json = JSON.parse(readFileSync("dist/index/circuit.json", "utf8"));
for (const layer of ["top", "bottom"] as const) {
  const svg = convertCircuitJsonToPcbSvg(json, {
    layer, width: 1400, matchBoardAspectRatio: true,
    shouldDrawErrors: true, showErrorsInTextOverlay: true,
  });
  writeFileSync(`dist/index/pcb-${layer}.svg`, svg);
  writeFileSync(`dist/index/pcb-${layer}.png`, new Resvg(svg).render().asPng());
}