Skip to content

Commit b4108f5

Browse files
authored
check for built-in i2s in example
1 parent 8d55410 commit b4108f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/tlv320_simpletest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
# dac.speaker_output = True
2626
# dac.speaker_volume = -20 # dB
2727

28-
audio = audiobusio.I2SOut(board.I2S_BCLK, board.I2S_WS, board.I2S_DIN)
28+
if "I2S_BCLK" and "I2S_WS" in dir(board):
29+
audio = audiobusio.I2SOut(board.I2S_BCLK, board.I2S_WS, board.I2S_DIN)
30+
else:
31+
audio = audiobusio.I2SOut(board.D9, board.D10, board.D11)
2932
# generate a sine wave
3033
tone_volume = 0.5
3134
frequency = 440

0 commit comments

Comments
 (0)