Datasheet

Usage
To demonstrate the usage of the amplifier we'll initialize it and control the volume from the board's Python REPL. Run
the following code to import the necessary modules and initialize the I2C connection with the amplifier:
Remember if you're using a board that doesn't support hardware I2C (like the ESP8266) you need to use
the bitbangio module instead:
Make sure some audio is playing through the amplifier, then you can control the volume using a few commands.
The first option is to set the volume property to an explicit value. This can be any number from 0 to 63 where 0 is
off/muted and 63 is maximum intensity (be careful, this amplifier can produce 20 watts of output which might damage
small speakers!)
For example to set a moderate half-way to max volume:
Or to mute/turn off the output:
In addition you can call the volume_up and volume_down functions to tell the amp to move up or down a single
volume level. This might be handy if your project only has an up/down volume control.
For example to move up 2 levels and then back down 1 level:
Again be careful to not increase the volume to such a high level that it damages your speakers!
That's all there is to using the MAX9744 amplifier with CircuitPython!
Below is a complete example of setting the volume of the amplifier. Save this as main.py on the board and it will set
the volume to a moderate/half-way level. Be sure to modify it to use the bitbangio module if necessary!
import board
import busio
import adafruit_max9744
i2c = busio.I2C(board.SCL, board.SDA)
amp = adafruit_max9744.MAX9744(i2c)
import board
import bitbangio
import adafruit_max9744
i2c = bitbangio.I2C(board.SCL, board.SDA)
amp = adafruit_max9744.MAX9744(i2c)
amp.volume = 31
amp.volume = 0
amp.volume_up()
amp.volume_up()
amp.volume_down()
© Adafruit Industries https://learn.adafruit.com/adafruit-20w-stereo-audio-amplifier-class-d-max9744 Page 35 of 37