SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By keithg
#82271
I have tested an LM386 circuit with multimeter and a small speaker so I know it is functional but I can't read meaningful values with this code
Code: Select all
void setup() {
   Serial.begin(9600);
}

void loop() {
  
  int soundLevel =  analogRead(0) -512;
  
  Serial.print( "soundIn = ");
  Serial.println(soundLevel);
 delay (1000);
}

I would appreciate advise.  Thanks.
By Liencouer
#82449
What are you trying to accomplish? How is the speaker/audio amp related to the analog input? What do you have hooked up to analog pin 0?