From 0a2e667017eedb9216c5fb30b2a4848ef539f5bb Mon Sep 17 00:00:00 2001 From: "Limor \"Ladyada\" Fried" Date: Sat, 8 Sep 2018 10:45:22 -0400 Subject: [PATCH] Update spinner.py --- examples/spinner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/spinner.py b/examples/spinner.py index 9dad7f8..8d27154 100644 --- a/examples/spinner.py +++ b/examples/spinner.py @@ -94,7 +94,7 @@ def get_position(self, delta): if clicksrc & 0b01000000 > 0: # Click was detected! Quickly read 32 values from the accelerometer # FIFO and look for the maximum magnitude values. - maxval = lis3dh.acceleration[0] # Grab just the X acceleration value. + maxval = abs(lis3dh.acceleration[0]) # Grab just the X acceleration value. for i in range(31): x = abs(lis3dh.acceleration[0]) if x > maxval: