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 2020import audiobusio
2121import board
2222import 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 )
2433
2534# CUSTOMISE COLORS HERE:
2635COLOR = (40 , 3 , 0 ) # Default idle is blood orange
7079
7180WAVE_FILE = None
7281
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
7983mic = audiobusio .PDMIn (board .MICROPHONE_CLOCK ,
8084 board .MICROPHONE_DATA ,
8185 sample_rate = 16000 ,
You can’t perform that action at this time.
0 commit comments