def addArduino(draw): left = { 'cnt': 10, 'labels': [ 'RESET', 'RESET2', 'AREF', 'N/C', 'A0', 'A1', 'A2', 'A3', 'A4/SDA', 'A5/SCL' ], 'plabels': ['2', '6', '7'], 'lblsize': 12, } right = { 'cnt': 17, 'labels': [ 'TX/D0', 'RX/D1', 'D2', 'PWM D3', 'D4', 'PWM D5', 'PWM D6', 'D7', 'D8', 'PWM D9', 'SS/PWM D10', 'MOSI/PWM D11', 'MISO/D12', 'SCK/D13', 'ICSP2 MISO', 'ICSP2 SCK', 'ICSP MISO' ], 'plabels': ['5', '3'], 'lblsize': 12, } top = { 'cnt': 3, 'labels': ['3v3', '5v', 'VIN'], 'plabels': ['4', '8'], 'lblsize': 12, } bot = { 'cnt': 1, 'labels': ['GND'], 'lblsize': 12, } return e.blackbox(draw.unit * 2.5, draw.unit * 4.5, linputs=left, rinputs=right, tinputs=top, binputs=bot, leadlen=1, mainlabel='Arduino\nUno\n(Rev3)')
import SchemDraw as schem import SchemDraw.elements as e d = schem.Drawing() right = {'cnt': 3, 'labels': ['GPIO0', 'GPIO1', 'GPIO2']} top = {'cnt': 1, 'labels': ['Vcc']} bot = {'cnt': 1, 'labels': ['GND']} Ard = e.blackbox(d.unit * 1.5, d.unit * 2.25, rinputs=right, tinputs=top, binputs=bot, leadlen=1, mainlabel='UNO') A = d.add(Ard) d.add(e.DOT_OPEN, label='$+5V$', xy=A.Vcc) GND = d.add(e.GND, xy=A.GND) Vin = d.add(e.DOT_OPEN, label='$V+$', xy=A.center + 5.55) L = d.add(e.RBOX, d='down', label='$Load$') S = d.add(e.BJT_NPN, anchor='collector', d='right') d.add(e.LINE, d='right', xy=A.GPIO0, tox=S.base, toy=S.base) ##N = d.add(e.DOT) ##d.add(e.LINE, d = 'right', xy = R1.end, l = d.unit*0.25) ##d.add(e.DOT_OPEN, label = '$V_2$') ##R2 = d.add(e.RES, xy = R1.end,d= 'down', label = '$R_{2}$')
import SchemDraw as schem import SchemDraw.elements as e rinputs = {'cnt': 1, 'labels': ['port_5']} binputs = {'cnt': 1, 'labels': ['GND']} d = schem.Drawing() ARDUINO = e.blackbox(d.unit, d.unit, rinputs=rinputs, binputs=binputs, mainlabel='ARDUINO') T = d.add(ARDUINO) BOT = d.add(e.GND, xy=T.GND) d.add(e.DOT) d.add(e.RBOX, d='right', xy=T.port_5, label='220$\Omega$') d.add(e.LED, flip=True, d='down', toy=BOT.start) d.add(e.LINE, d='left', tox=BOT.start) d.draw() d.save('source/Blink.eps')
import SchemDraw as schem import SchemDraw.elements as e d = schem.Drawing() rinputs = { 'cnt': 6, 'labels': ['port_2', 'port_3', 'port_4', 'port_5', 'port_6', 'port_7'] } binputs = {'cnt': 1, 'labels': ['GND']} d = schem.Drawing() ARDUINO = e.blackbox(d.unit * 1.3, d.unit * 2.25, rinputs=rinputs, binputs=binputs, mainlabel='ARDUINO') T = d.add(ARDUINO) d.push() d.add(e.RBOX, label='1000$\Omega$', xy=T.port_2) d.add(e.LED) d.add(e.DOT) d.add(e.GND) d.pop() d.push() d.add(e.RBOX, label='1000$\Omega$', xy=T.port_3) d.add(e.LED) d.add(e.DOT) d.add(e.GND) d.pop()
import SchemDraw as schem import SchemDraw.elements as e d = schem.Drawing() top = {'cnt':2, 'labels':['+','-'], 'plabels':['1','2'], 'lblsize':12, } Fan = e.blackbox(d.unit*2, d.unit*2, tinputs=top,leadlen=1.5, mainlabel='Fan') T = d.add(Fan) d.draw()
import SchemDraw as schem import SchemDraw.elements as e d = schem.Drawing() top = { 'cnt': 9, 'labels': ['L', 'N', 'Gnd', '-v', '-v', '-v', '+v', '+v', '+v'], 'plabels': ['4', '8'], 'lblsize': 12, } Power = e.blackbox(d.unit * 2.5, d.unit * 4.5, tinputs=top, leadlen=1, mainlabel='Power') T = d.add(Power) d.draw()