Documentation ¶
Index ¶
Constants ¶
View Source
const ( Axial1Band int = iota + 1 // 0 Ω resistors are single black band Axial3Band int = iota + 2 Axial4Band Axial5Band Axial6Band )
View Source
const ( Invalid = -1 DefaultTolerance = 20 )
Variables ¶
Functions ¶
Types ¶
type Band ¶
type Band struct { Code string `json:"code"` // SignificantFigures is a digit of the resistor value in ohms. SigFig float64 `json:"sig_fig,omitempty"` // Multiplier is the multiplier of the resistor value. Multiplier float64 `json:"multiplier,omitempty"` // Tolerance is the tolerance of the resistor value in percentage. Tolerance float64 `json:"tolerance,omitempty"` // TCR is the temperature coefficient of resistance in ppm/K. TCR int `json:"tcr,omitempty"` }
func ColorToBand ¶
ColorToBand returns the Band struct for the given BandColor.
type Resistor ¶
type Resistor struct { // IsReversed from input order. IsReversed bool `json:"reversed"` // Bands is the color bands on the resistor. Bands []Band `json:"bands"` }
Resistor is an axial resistor with color bands to represent its value.
Click to show internal directories.
Click to hide internal directories.