nycjv321 / resistor-color-code-lib

Little Go app to calculate electrical resistance given a list of colors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resistor Color Code Calculator

Go library to calculate resistance ± tolerance given a list of bands as well as vice versa.

Installation

Clone this project to "$GOPATH/src/javierlvelasquez.com/resistor-color-code-calculator".

Example Usage

Calculating resistance ± tolerance

resistance.Calculate("White,Violet,Yellow,Black,gray") // returns 9.74 h Ω ± 0.05% tolerance

Calculating bands

bds, err = parser.DetermineBands([]int{2, 7}, []int{}, "k", .01) // returns "Red", "Violet", "Orange", "Brown" (as a list of colors)

Example Implementation

See a cli implementation here.

About

Little Go app to calculate electrical resistance given a list of colors.


Languages

Language:Go 99.2%Language:Shell 0.8%