From 76379deb1fb6d26670f2bd370e62fe43df81ff13 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Tue, 5 Mar 2024 20:40:50 +0100 Subject: [PATCH] PCB: Replace reset button with more fitting footprint --- ergogen/config.yaml | 2 +- ergogen/footprints/button_6x6.js | 48 ++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 ergogen/footprints/button_6x6.js diff --git a/ergogen/config.yaml b/ergogen/config.yaml index 40b018a..f446e87 100644 --- a/ergogen/config.yaml +++ b/ergogen/config.yaml @@ -248,7 +248,7 @@ pcbs: reset_button: # TODO: Check if the footprint fits to the buttons we ordered - what: button + what: button_6x6 where: ref: pad_four_five shift: [ 0, 15 ] diff --git a/ergogen/footprints/button_6x6.js b/ergogen/footprints/button_6x6.js new file mode 100644 index 0000000..034877d --- /dev/null +++ b/ergogen/footprints/button_6x6.js @@ -0,0 +1,48 @@ +// Tactile button 6x6mm +// Source: https://kicad.github.io/footprints/Button_Switch_SMD +module.exports = { + params: { + designator: 'B', + side: 'F', + from: undefined, + to: undefined + }, + body: p => ` + (module SW_Push_1P1T_NO_6x6mm_H9.5mm (layer F.Cu) (tedit 5CA1CA7F) + (descr "tactile push button, 6x6mm e.g. PTS645xx series, height=9.5mm") + (tags "tact sw push 6mm smd") + (attr smd) + + ${p.at /* parametric position */} + + ${'' /* footprint reference */} + (fp_text reference "${p.ref}" (at 0 -4.05) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)))) + (fp_text value "" (at 0 4.15) (layer F.SilkS) hide (effects (font (size 1 1) (thickness 0.15)))) + + ${'' /* outline */} + (fp_line (start -3 -3 ) (end -3 3 ) (layer ${p.side}.Fab) (width 0.1)) + (fp_line (start -3 3 ) (end 3 3 ) (layer ${p.side}.Fab) (width 0.1)) + (fp_line (start 3 3 ) (end 3 -3 ) (layer ${p.side}.Fab) (width 0.1)) + (fp_line (start 3 -3 ) (end -3 -3 ) (layer ${p.side}.Fab) (width 0.1)) + (fp_line (start 5 3.25) (end 5 -3.25) (layer ${p.side}.CrtYd) (width 0.05)) + (fp_line (start -5 -3.25) (end -5 3.25) (layer ${p.side}.CrtYd) (width 0.05)) + (fp_line (start -5 3.25) (end 5 3.25) (layer ${p.side}.CrtYd) (width 0.05)) + (fp_line (start -5 -3.25) (end 5 -3.25) (layer ${p.side}.CrtYd) (width 0.05)) + (fp_line (start 3.23 -3.23) (end 3.23 -3.2 ) (layer ${p.side}.SilkS) (width 0.12)) + (fp_line (start 3.23 3.23) (end 3.23 3.2 ) (layer ${p.side}.SilkS) (width 0.12)) + (fp_line (start -3.23 3.23) (end -3.23 3.2 ) (layer ${p.side}.SilkS) (width 0.12)) + (fp_line (start -3.23 -3.2 ) (end -3.23 -3.23) (layer ${p.side}.SilkS) (width 0.12)) + (fp_line (start 3.23 -1.3 ) (end 3.23 1.3 ) (layer ${p.side}.SilkS) (width 0.12)) + (fp_line (start -3.23 -3.23) (end 3.23 -3.23) (layer ${p.side}.SilkS) (width 0.12)) + (fp_line (start -3.23 -1.3 ) (end -3.23 1.3 ) (layer ${p.side}.SilkS) (width 0.12)) + (fp_line (start -3.23 3.23) (end 3.23 3.23) (layer ${p.side}.SilkS) (width 0.12)) + (fp_circle (center 0 0) (end 1.75 -0.05) (layer ${p.side}.Fab) (width 0.1)) + + ${'' /* pins */} + (pad 1 smd rect (at -3.975 -2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.from}) + (pad 1 smd rect (at 3.975 -2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.from}) + (pad 2 smd rect (at -3.975 2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.to}) + (pad 2 smd rect (at 3.975 2.25 ${p.r}) (size 1.55 1.3) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask) ${p.to}) + ) + ` +}