Skip to content

Commit 93d6749

Browse files
committed
update clue step counter
1 parent 167227a commit 93d6749

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CLUE/Clue_Step_Counter/code.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@
99
from simpleio import map_range
1010
from adafruit_bitmap_font import bitmap_font
1111
from adafruit_lsm6ds.lsm6ds33 import LSM6DS33
12+
from adafruit_lsm6ds.lsm6ds3trc import LSM6DS3TRC
1213
from adafruit_lsm6ds import Rate, AccelRange
1314
from adafruit_progressbar.progressbar import ProgressBar
1415
from adafruit_display_text.label import Label
1516

1617
# turns off onboard NeoPixel to conserve battery
17-
clue.pixel.brightness = (0.0)
18+
clue.pixel.brightness = 0.0
1819

1920
# accessing the Clue's accelerometer
2021
sensor = LSM6DS33(board.I2C())
22+
try:
23+
sensor = LSM6DS33(board.I2C())
24+
except RuntimeError:
25+
sensor = LSM6DS3TRC(board.I2C())
2126

2227
# step goal
2328
step_goal = 10000

0 commit comments

Comments
 (0)