MustafaMulla29/rp2040-bldc-motor-controller

Hardware assembly metadata and PCB geometry for a controller board with a snap-off rotary-encoder section, plus four parallel 150 µF/50 V bulk electrolytic capacitors filtering the motor supply.

Version
2.0.40
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone MustafaMulla29/rp2040-bldc-motor-controller  # download the package files into ./rp2040-bldc-motor-controller
tsci add MustafaMulla29/rp2040-bldc-motor-controller    # add it to your project as @tsci/MustafaMulla29.rp2040-bldc-motor-controller

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.

enclosure/export-board.tsx

import {createHash} from "node:crypto"
import {copyFile,readFile,writeFile} from "node:fs/promises"
export async function exportBoardPreview(){
 const bytes=await readFile(new URL("../dist/pcb/circuit.json",import.meta.url))
 const provenance=JSON.parse(await readFile(new URL("../assembly/dist/assets/compact-board.provenance.json",import.meta.url),"utf8"))
 if(provenance.sha256!==createHash("sha256").update(bytes).digest("hex"))throw Error("Refresh native PCB GLB first")
 await copyFile(new URL("../assembly/dist/assets/compact-board.glb",import.meta.url),new URL("dist/board.glb",import.meta.url))
 await copyFile(new URL("../assets/connected-system.glb",import.meta.url),new URL("dist/connected-system.glb",import.meta.url))
 await writeFile(new URL("dist/board.provenance.json",import.meta.url),JSON.stringify(provenance,null,2)+"\n")
 console.log("Copied verified native PCB and connected accessory models")
}