A simple serial test program for the MAX9723 library.

Dependencies:   MAX9723 mbed

main.cpp

Committer:
neilt6
Date:
2014-05-30
Revision:
0:b141b0729a1b

File content as of revision 0:b141b0729a1b:

#include "mbed.h"
#include "MAX9723.h"

//Create a MAX9723 object at the default address (ADDRESS_0)
MAX9723 amp(p28, p27);

int main()
{
    //Try to open the MAX9723
    if (amp.open()) {
        printf("Device detected!\n");

        //Configure the MAX9723 for no BassMax, and low gain
        amp.enabled(true);
        amp.bassMax(false);
        amp.maxGain(false);
        
        //Set the volume for 50%
        amp = 0.50;
    } else {
        error("Device not detected!\n");
    }
}