Quote Originally Posted by charudatt View Post
thanks peterdeco,

Yes i looked upon your code in the last thread, and its for a single led. But I want PORTB to dance to the music.

I have a slight confusion in my mind, regarding the ADC Val that we sample. Does it mean that we are actually making a VU meter. How do we sample different frequencies ?

No Clue.I
You don't sample different frequencies with an ADC, at least not without banks of wide- or narrow- band filters. All you sample with an ADC is analog values.

You can sample a segment of ADC values, do some complex math on it and get a spectrum display out of it (see Post #2), but it isn't easy, it's time/memory consuming with a PIC18F. There are a few graphic equalizer chips out there that'll split the audio into bands of frequencies which you could then sample individually, but again, it's not easy. I guess it depends on how many 'bands of frequencies' you're talking about...