Skip to content

Commit d2f4fb1

Browse files
authored
Merge pull request adafruit#1104 from kevinjwalters/cluesensorplotter
CLUE Metal Detector in CircuitPython - minor code update
2 parents 7d45b71 + 2eb99cc commit d2f4fb1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CLUE_Metal_Detector/clue-metal-detector.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# clue-metal-detector v1.5
1+
# clue-metal-detector v1.6
22
# A simple metal detector using a minimum number of external components
33

44
# Tested with an Adafruit CLUE (Alpha) and CircuitPython 5.2.0
@@ -472,7 +472,7 @@ def sample_sum(pin, num):
472472
"\n".join(["Button Guide",
473473
"Left: audio",
474474
" 2secs: NeoPixel",
475-
" 4s: Screen",
475+
" 4s: screen",
476476
" 6s: Mu output",
477477
"Right: recalibrate"]), duration=10)
478478

@@ -685,7 +685,8 @@ def sample_sum(pin, num):
685685
voltage_hist_idx = 0
686686
voltage_hist_complete = False
687687
voltage_hist_median = None
688-
base_mx, base_my, base_mz = mx, my, mz
688+
if magnetometer is not None:
689+
base_mx, base_my, base_mz = mx, my, mz
689690

690691
display.auto_refresh = False
691692

0 commit comments

Comments
 (0)