Go Down

Topic: Arduino controls an LM4832 Headphone Amp with I2C (Read 1 time) previous topic - next topic

sathopper

Jan 25, 2014, 08:39 pm Last Edit: Jan 25, 2014, 08:45 pm by sathopper Reason: 1
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  :P

First test are looking good :)

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 :)

http://www.youtube.com/watch?v=Ekrr-rLkQ7Y

Quote
/*
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(); }

Go Up