Description Usage Arguments Details Value Author(s) See Also Examples
Draw an ic
1 2 3 |
x0,y0 |
coordinate of lower-left corner of element |
x1,y1 |
coordinate of upper-right corner of element |
type |
type of IC |
col |
colour |
lwd |
line width |
cex |
size of points (ignored unless |
The coordinate system has both x and y ranging from 0 to 1.
A list containing pin information; elements are coordinates x
and
y
, label label
, number number
, and position
pos
.
Dan Kelley
The plot must first be set up with circuit
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## An oscillator built using a 555 IC.
library(circuit)
circuit()
p <- ic(0.3, 0.2, 0.5, 0.5)
ctrl <- p[[5]]
gnd <- p[[1]]
trig <- p[[2]]
out <- p[[3]]
res <- p[[4]]
thr <- p[[6]]
dis <- p[[7]]
vcc <- p[[8]]
capacitor(ctrl$x, ctrl$y-0.1, ctrl$x, ctrl$y, label="10nF", pos=4)
wire(gnd$x, gnd$y-0.1, gnd$x, gnd$y)
wire(0.1, 0.1, ctrl$x, 0.1)
label(0.1, 0.1, "GND", pos=2)
wire(out$x, out$y, out$x+0.1, out$y)
label(out$x+0.1, out$y, "VOUT", pos=4)
# top
wire(res$x, res$y, res$x, res$y+0.1)
wire(vcc$x, vcc$y, vcc$x, vcc$y+0.1)
wire(0.1, vcc$y+0.1, vcc$x, vcc$y+0.1)
label(0.1, vcc$y+0.1, "VCC", pos=2)
# lhs components
resistor(0.15, dis$y, 0.1, 0.6, label="R1")
resistor(0.15, 0.3, 0.1, dis$y, label="R2")
wire(0.15, dis$y, dis$x, dis$y)
wire(0.25, thr$y, thr$x, thr$y)
wire(0.25, trig$y, trig$x, trig$y)
wire(0.25, thr$y, 0.25, trig$y-0.05)
wire(0.15, trig$y-0.05, 0.25, trig$y-0.05)
capacitor(0.15, ctrl$y-0.1, 0.15, trig$y-0.05, label="C")
wire(0.15, trig$y-0.05, 0.15, 0.3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.