File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 20
20
import audiobusio
21
21
import board
22
22
import neopixel
23
- import adafruit_lsm6ds
23
+
24
+ i2c = board .I2C () # uses board.SCL and board.SDA
25
+
26
+ # check for LSM6DS33 or LSM6DS3TR-C
27
+ try :
28
+ from adafruit_lsm6ds .lsm6ds33 import LSM6DS33 as LSM6DS
29
+ sensor = LSM6DS (i2c )
30
+ except RuntimeError :
31
+ from adafruit_lsm6ds .lsm6ds3 import LSM6DS3 as LSM6DS
32
+ sensor = LSM6DS (i2c )
24
33
25
34
# CUSTOMISE COLORS HERE:
26
35
COLOR = (40 , 3 , 0 ) # Default idle is blood orange
70
79
71
80
WAVE_FILE = None
72
81
73
- i2c = board .I2C () # uses board.SCL and board.SDA
74
- # i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
75
-
76
- #Set up accelerometer & mic
77
-
78
- sensor = adafruit_lsm6ds .LSM6DS33 (i2c )
82
+ #Set up mic
79
83
mic = audiobusio .PDMIn (board .MICROPHONE_CLOCK ,
80
84
board .MICROPHONE_DATA ,
81
85
sample_rate = 16000 ,
You can’t perform that action at this time.
0 commit comments