rushabhcodes/wireless-split-keyboard

Wireless Split Keyboard — custom routed nRF52840 split PCBs with a printable enclosure

Version
0.4.5
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone rushabhcodes/wireless-split-keyboard  # download the package files into ./wireless-split-keyboard
tsci add rushabhcodes/wireless-split-keyboard    # add it to your project as @tsci/rushabhcodes.wireless-split-keyboard

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.

scripts/extract_nordic_layout.py

from pathlib import Path
import re,json,hashlib
root=Path(__file__).resolve().parents[1]
p=root/'references/nordic-config5-placement.txt'
rows={}
for line in p.read_text(errors='replace').splitlines():
 m=re.match(r'(\w+)\s+(?:"[^"]*"|\S+)\s+TopLayer\s+\S+\s+(-?[\d.]+)\s+(-?[\d.]+)\s+([\d.]+)',line)
 if m:
  ref,x,y,rot=m.groups();rows[ref]={'dx':round(-float(x)*.0254,7),'dy':round(float(y)*.0254,7),'rotation':(-float(rot))%360}
assert len(rows)>=30
(root/'src/generated/nordic-config5-layout.json').write_text(json.dumps(rows,indent=2)+'\n')
print('Transcribed',len(rows),'individual reference component anchors, reflected for bottom-side placement')