From 47d55f8ce945dc9c90d819a9c86c11678c3936a6 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 20 Mar 2023 14:14:00 -0300 Subject: [PATCH] [Experiments] Added mechanism to supress 20% fake color band --- experiments/resistor_colors/test_wrl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/experiments/resistor_colors/test_wrl.py b/experiments/resistor_colors/test_wrl.py index 94411686..111d1f4a 100644 --- a/experiments/resistor_colors/test_wrl.py +++ b/experiments/resistor_colors/test_wrl.py @@ -97,7 +97,7 @@ def add_colors(file, colors): val = 1200 -tol = 5 +tol = 20 if val < 0.01: print('Minimum value is 10 mOhms') @@ -138,6 +138,11 @@ if tol_color is None: print('Unknown tolerance {}'.format(tol)) exit(3) bars[nbars-1] = tol_color +# For 20% remove the last bar +if tol_color == 12: + bars = bars[:-1] + WIDTHS[-3] = WIDTHS[-1]+WIDTHS[-2]+WIDTHS[-3] + WIDTHS = WIDTHS[:-2] # Show the result print(bars)