diff options
author | Karl Berry <karl@freefriends.org> | 2020-12-21 22:02:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-12-21 22:02:51 +0000 |
commit | c95edccc8198456a8a1a43c7b2c70a02ca8d84ac (patch) | |
tree | 7b75eb11432c27bc72182e261983078fd196620a /Master/texmf-dist/doc/latex/circuit-macros/examples/ex01.m4 | |
parent | 88e74ca1539a00a016c46ca3ac678158efe5286e (diff) |
circuit-macros (21dec20)
git-svn-id: svn://tug.org/texlive/trunk@57189 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/examples/ex01.m4')
-rw-r--r-- | Master/texmf-dist/doc/latex/circuit-macros/examples/ex01.m4 | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/examples/ex01.m4 b/Master/texmf-dist/doc/latex/circuit-macros/examples/ex01.m4 index a5bcef47abd..e672fccc364 100644 --- a/Master/texmf-dist/doc/latex/circuit-macros/examples/ex01.m4 +++ b/Master/texmf-dist/doc/latex/circuit-macros/examples/ex01.m4 @@ -1,6 +1,56 @@ .PS -# ex01.m4 +# Timer.m4 cct_init +iflatex(`latexcommand({\small\sf)') + +define(`ic555',`[Chip: box ht boxwid wid boxwid "555" + P7: "7" ljust at 1/6<Chip.sw,Chip.nw> + P6: "6" ljust at 1/2<Chip.sw,Chip.nw> + P2: "2" ljust at 5/6<Chip.sw,Chip.nw> + P4: "4" below at 1/3<Chip.nw,Chip.ne> + P8: "8" below at 2/3<Chip.nw,Chip.ne> + P3: "3" rjust at Chip.e + P1: "1" above at Chip.s + ]') + +Timer: [ + define(`elen_',`linewid') +Vs: dot + down_ + variable(`resistor(,E); llabel(,\SI{1}{M})') + resistor(,E); llabel(,\SI{100}{\kilo{}}) + capacitor(,E); llabel(\SI{220}{\micro{}}) +Zero: dot + + dot(at Vs+(elen_*4/3,0)) + resistor(,E); llabel(,\SI{33}{\kilo{}}) + line to (Here,Zero) chop 0 chop elen_ +C2: capacitor; llabel(\SI{0.1}{\micro{}}) + dot + +IC1: ic555 with .P7 at C2.start + (elen_,0) + line from IC1.P4 to (IC1.P4,Vs); dot + line from IC1.P8 to (IC1.P8,Vs); dot + line from IC1.P1 to (IC1.P1,Zero); dot + line from IC1.P2 to (C2,IC1.P2); dot + crossover(from IC1.P7 to (Zero,IC1.P7),R,C2); dot + line from IC1.P6 left elen_/2 then down IC1.P6.y-IC1.P7.y; dot + line from IC1.P3 right elen_*2/3 +R: dot + line right_ elen_/3 +B: buzzer(,,C) with .In3 at Here + line from B.In1 to (R,B.In1) + reversed(`diode',to (Here,Vs),LE); "red" at last line.c+(elen_/2,0) + resistor(down_ elen_ from R,E); llabel(,\num{470}) + diode(to (Here,Zero),LE); {"green" at last line.c+(elen_*2/3,0)} + line to Zero chop 0 chop -elen_ + line up_ (Vs.y-Here.y)/3 + battery(up_ (Vs.y-Here.y)/3); rlabel(,,\SI{9}{V}) + switch(to (Here,Vs),,D) + line to (R,Vs) +] +Ex01: [ +# ex01.m4 linewid = linewid*1.5 # let's make the circuit elements bigger than usual define(`elen_',linewid) # but not longer del = elen_/4 # a spacing parameter @@ -18,4 +68,7 @@ cct_init arcd(last []+(4pt__,0),del,30,330) <- ; "$i_2$" at last arc arcd(Vin.c+(4*del,0),2*del,30,330) <- ; "$i_1$" at last arc + ] with .sw at Timer.se+(0.5,0) + +iflatex(`latexcommand(}%)') .PE |