For Feather M4 Express:
Connect VIN on the breakout to 3V on the board.
Connect GND on the breakout to Gnd on the
board.
Connect BCLK on the breakout to TX on the
board.
Connect WSEL on the breakout to D10 on the
board.
Connect DIN on the breakout to D11 on the board.
For Metro M4 Express:
Connect VIN on the breakout to 3.3 on the board.
Connect GND on the breakout to GND on the
board.
Connect BCLK on the breakout to D3 on the
board.
Connect WSEL on the breakout to D9 on the
board.
Connect DIN on the breakout to D8 on the board.
Code Examples
We have two CircuitPython code examples. The first plays a generated tone through the audio jack on the breakout.
The second plays a wave file. Let's take a look!
Tone Generation
The first example generates one period of a sine wave and then loops it to generate a tone. You can change the
volume and the Hz of the tone by changing the associated variables. Inside the loop, we play the tone for one second
and stop it for one second.
The default volume of the audio in the following code is very high. Do put on plugged in headpones before
first running the code to check the volume.