Arduino controls an LM4832 Headphone Amp with I2C

I'm building a Headphone AMP with Tone control using the LM4832. Cheap to buy on Ebay.
This way I can have a better and Powerful sound than I can get direct out of my IPad and/or IPhone :stuck_out_tongue:

First test are looking good :slight_smile:

This Sketch should awaken the LM4832 and you can get a LED to Flash on the General output.
Download the Datasheet and you can control the other features of the LM4832 :slight_smile:

/*
HeadPhone Amp controlling LM4832
*/

#include <Wire.h> // I2C Library

byte LM4832Address = 0x80 >> 1; // I2C bus address for LM4832 (pin 15 and 16 to GND)

void setup()
{ Serial.begin(9600); //
Wire.begin(); //
// General control:
Wire.beginTransmission(LM4832Address);
Wire.write(B11100010);
Wire.endTransmission();
// Set volume in
Wire.beginTransmission(LM4832Address);
Wire.write(B00000010);
Wire.endTransmission();
// Set volume out LEFT:
Wire.beginTransmission(LM4832Address);
Wire.write(B10001001);
Wire.endTransmission();
// Set volume out RIGHT:
Wire.beginTransmission(LM4832Address);
Wire.write(B01101001);
Wire.endTransmission();

Serial.println("LM4832 Initialized!");}

void loop()
{ Serial.println("Running in loop");
delay(500);
// LED ON
Wire.beginTransmission(LM4832Address);
Wire.write(B11100010);
Wire.endTransmission();
delay (500);
// LED OFF
Wire.beginTransmission(LM4832Address);
Wire.write(B11100000);
Wire.endTransmission(); }