From fe4cd6dbdd5a576d795db3d19f6f5ffcf45e56bd Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Fri, 13 May 2022 18:41:38 -0700 Subject: Add an active probe to the test circuit --- test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test.rb b/test.rb index b0e9dd4..f63b557 100755 --- a/test.rb +++ b/test.rb @@ -38,6 +38,16 @@ def btn(color="black") pair(sw[1], sw[3]) end +def probe(attenuation=20, impedance=50) + jack = comp("J", "SMB", "SMB jack", "#{attenuation}x #{impedance}ohm probe") + jack[2] - jack[3] - jack[4] - jack[5] + if attenuation == 1 + pair(jack[1], jack[2]) + else + pair(r("#{(attenuation-1)*impedance}ohm") - jack[1], jack[2]) + end +end + nl = Lace::Netlist.new do $vcc = net("vcc") $gnd = net("gnd") @@ -50,6 +60,7 @@ nl = Lace::Netlist.new do x = $vcc - btn("white") x - net("x") - led("amber") - $gnd x - inverter() - net("xbar") - led("blue") - $gnd + x - probe - $gnd end nl.kicad -- cgit v1.2.3