LED to music code


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: LED to music code

    Hi. I did something like this several years ago using PULSIN. It is not too accurate though because music contains many different frequencies at a single time. I did however change the code to ADCIN. It would light up different colors of LEDs depending on the volume level. Hope this helps.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: LED to music code

    Do a google search for "pic color organ code" and you should find lots of examples.
    Tim Barr

  3. #3
    Join Date
    Nov 2014
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: LED to music code

    Quote Originally Posted by peterdeco1 View Post
    Hi. I did something like this several years ago using PULSIN. It is not too accurate though because music contains many different frequencies at a single time. I did however change the code to ADCIN. It would light up different colors of LEDs depending on the volume level. Hope this helps.
    Yeah that’s why I was thinking to use like 3 or 4 colors and set each to a frequency range of musical pitch. I'm unfamiliar with the PULSIN command of PIC Basic would you still happen to have your code?
    Last edited by Dickeysbbq; - 14th November 2014 at 06:23.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: LED to music code

    I found it. I didn't use PULSIN, I used COUNT. Again I had inconsistent results. Maybe you can play with COUNT duration for better results. I used an array of red, green and blue leds. Lighting up 2 or more colors like red and blue makes purple.

    Count PORTA.3, 10, FREQ
    IF FREQ > 9 Then BLUEGREENLED
    IF FREQ > 8 Then REDLED
    IF FREQ > 7 Then GREENREDLED
    IF FREQ > 6 Then GREENLED 'looking FOR 600HZ
    IF FREQ > 5 Then BLUELED 'LOOKING FOR 500HZ
    IF FREQ > 4 Then REDLED 'LOOKING FOR 400HZ
    IF FREQ > 3 Then REDBLUELED '300HZ
    IF FREQ > 2 Then WHITELED '200 HZ
    IF FREQ < 1 Then Pause 300
    IF FREQ < 1 Then Low PORTB.0 : Low PORTB.4 : Low PORTB.7 'OFF LEDS

Similar Threads

  1. Replies: 5
    Last Post: - 21st January 2014, 16:10
  2. Replies: 11
    Last Post: - 29th November 2013, 16:42
  3. LED 'Dot' Bargraph Issues - Newbie Code!
    By SOTASOTA in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 15th February 2013, 19:25
  4. Replies: 5
    Last Post: - 7th February 2012, 17:58
  5. Driver code for 14 segment LED display
    By Durward Searcy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th December 2004, 20:08

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts