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.

scripts/export_tables.py

#!/usr/bin/env python3
"""BOM and assembly-position review tables from the same built circuit."""
import csv
import json
from pathlib import Path
root = Path(__file__).resolve().parents[1]
items = json.loads((root/'dist/index/circuit.json').read_text())
source = {o['source_component_id']: o for o in items if o['type']=='source_component'}
rows=[]
for pcb in (o for o in items if o['type']=='pcb_component'):
    if pcb['source_component_id'] not in source: continue
    s=source[pcb['source_component_id']]
    value=next((s[k] for k in ('display_capacitance','display_resistance','display_inductance','display_frequency','capacitance','resistance','inductance','frequency') if k in s), '')
    pads = s['name'] in ('J1','J2','J3','J5','J6')
    rows.append([s['name'],s['ftype'],value,s.get('manufacturer_part_number',''),
        ';'.join(s.get('supplier_part_numbers',{}).get('jlcpcb',[])),
        'PCB solder lands; no purchased connector' if pads else ('Specified MPN; verify assembly and availability' if s.get('manufacturer_part_number') else 'Automatic supplier candidate; verify ratings and land pattern'),
        pcb['center']['x'],pcb['center']['y'],pcb['rotation'],pcb['layer']])
with (root/'docs/bom-and-placement.csv').open('w',newline='') as f:
    w=csv.writer(f);w.writerow(['Reference','Type','Value','MPN','JLC_candidate','Assembly_note','X_mm_board_center','Y_mm_board_center','Rotation_deg','Side']);w.writerows(rows)
print(f'Wrote {len(rows)} component/land rows; this is a review table, not a procurement approval.')