Pins
In typeCAD, the Pin
object represents the pin/leg/lead/ball etc. of a component.
Pin
All Component
objects have a ::pin()
function that returns a Pin
object for the number passed.
import { Resistor } from '@typecad/passives/0805'
let r1 = new Resistor({ value: '1kohm' });
r1.pin(1); // to get the pin object for the first pin
r1.pin(2); // and the second
Using ::pin()
like that is the simplest way, but for more complex components, it can become unwieldy remembering which pin is which.
A more declarative way to use/create Pin
objects is described in the components page. Using the typeCAD tooling, any given component can be created giving access to Pin
objects that allow them to be used with a descriptive name.
import { ATtiny85_20S } from './ATtiny85_20S';
let u1 = new ATtiny85_20S();
u1.VCC // for this particular component, the VCC pin is pin 8
u1.GND // GND is pin 4
On This Page