RESISTOR COLOUR CODE (16K ZX81)
by J P Roebuck, Huddersfield
from ZX Computing (December 1984/January 1985), page 49

J P Roebuck from Huddersfield supplies all electronic constructors with this handy 16K colour band decoder.

Although written for the ZX81 this program should work as printed on the Spectrum as well.

As most dabblers in electronics know, the value of a resistor is given by a set of colours printed on it's side. This program will decode the full four bands almost instantly!


Description

10-20      print main heading
30-90      input the colours of the resistor
100-110    tell the operator to wait
120        goto the routine
130-200    print answer and rerun the programme
1000-1100  set up the variables
1110-1150  check first 3 inputs and define the answer
1160-1180  check the last input and define the answer
1190       let variable H equal the first 2 answers
1210-1230  let H equal the third answer as well
1240-1260  check if the answer is in mega, kila or ohms
3000-3010  define d$ as ohms
3100-3120  define d$ as kila ohms
3200-3230  define d$ as mega ohms
9000-9010  save and auto run


Variables

A$         input variable
B$         master variable to check A$ with
C$         first parts of the answer
D$         type size of the answer ie mega
H          the final answer
C$(4)      the tolerance