Define the schematic
Open blinky.sch.tsx in the project from either setup page. A schematic describes which pins connect. The board layout will decide where those pins sit and how copper joins them.
Read one connection
Blinky names four board-level nets: GND, VCC, SIG and SW. Its header makes their entry points explicit:
Find J1’s declaration in the complete file below. PinHeader(3) chooses a three-pin footprint factory; calling it creates the part. .connect() assigns each pin a net. A net is a value returned by nets(), so pass VCC, rather than the string 'VCC'.
The constant name J1 becomes the part reference in the viewer, silk and BOM. Pin handles such as J1[3] let routes and schematic wires name the same pin later.
Follow the circuit
Signal SIG reaches Q1's pin 1. Q1's pin 2 connects to ground, and pin 3 is on SW. Each LED channel runs from VCC, through a resistor and LED, to SW. Q1 switches that common return.
This first lesson inspects the schematic of the supplied working layout. The other source tabs include its actual placements, so the preview has no hidden setup. The next lesson starts a fresh outline and adds placements progressively.
// Blinky, the schematic: three LED channels switched by one transistor, fed from a three-pin header, and its picture. // J1, Q1 and C1 sit at the board level, each named by its constant; each channel is an instance of the ledChannel circuit with its index. // A channel's parts take its index: R and D of CH1 are R1 and D1, of CH2 R2 and D2, of CH3 R3 and D3. // D and Q1 carry their part numbers inline; J1, the resistors and C1 get theirs from blinky.sourcing.ts. import { nets, Schematic, Sheet, Power, Text, wire } from '@pcbjs/core' import { PinHeader, C0603 } from '@pcbjs/lib' import { SOT23 } from './lib/MyPart' import { schematic as ledChannel } from './lib/led-channel' export const { GND, VCC, SIG, SW } = nets() export const J1 = PinHeader(3)().connect({ 1: GND, 2: VCC, 3: SIG }) export const Q1 = SOT23('MMBT3904').source({ MPN: 'MMBT3904LT1G', Manufacturer: 'onsemi' }).connect({ 1: SIG, 2: GND, 3: SW }) // decoupling on the supply export const C1 = C0603('100n').connect({ 1: VCC, 2: GND }) // the channels: CH1.R is a resistor, CH1.nets.led the net between it and CH1.D export const CH1 = ledChannel({ VCC, SW }, 'CH1') export const CH2 = ledChannel({ VCC, SW }, 'CH2') export const CH3 = ledChannel({ VCC, SW }, 'CH3') // the picture: a part inside <Schematic> is its symbol; where each sits and the wires drawn by hand, in grid units of 2.54 mm; // GND and VCC get power symbols from the compiler, and C1 is placed but wired by it too const channel = (ch: typeof CH1, y: number) => ( <Sheet group={ch} at={`23 ${y}`}> <ch.R at="2 2" /> <ch.D at="8 2" /> {wire(ch.R[2]).Z(ch.D.A)} </Sheet> ) export const drawing = ( <Schematic> <J1 at="4 7" /> <Q1 at="13 10" /> <C1 at="6 18" rot={270} /> {wire(J1[3]).Z(Q1[1])} <Power net={GND} at="14 12" kind="gnd" /> {channel(CH1, 5)} {channel(CH2, 12)} {channel(CH3, 19)} {wire(CH1.D.K).h(2).v(14).Z(CH3.D.K)} {wire(CH2.D.K).h(2)} {wire(Q1[3]).V(3).H(35).V(7)} <Text at="4 26">Three LED channels switched low by Q1</Text> </Schematic> )
The three instances CH1, CH2 and CH3 reuse lib/led-channel.tsx. Each has its own resistor, LED and private net between them. The shared VCC and SW connections are its ports. You can use this circuit without learning how to author a reusable circuit yet.
Connections and drawing are separate
The exported drawing uses <Schematic> to position symbols and wire() to draw their links. Those positions are sheet coordinates, with a default grid of 2.54 mm, not the board's millimetre positions. A part inside <Schematic> draws its symbol; the same part on a board draws its footprint.
Changing a symbol's position rearranges the picture. Change .connect() when the electrical connection itself must change. Manufacturer part numbers live in blinky.sourcing.ts, imported by the board, so they do not obscure this circuit description.
Try it: find C1 and read its two connections. It sits across VCC and GND. Locate those nets in the schematic view before moving anything.
Next: Define the board. For the complete API, see Schematic reference.