Connect with us

Teensy++ help (microcontroller // digital & analog)

Discussion in 'Microcontrollers, Programming and IoT' started by R_K, Nov 16, 2013.

Scroll to continue with content
  1. R_K

    R_K

    1
    0
    Nov 16, 2013
    Hi,
    I'm pretty rusty on my electronics but would really like to get back into it because I have a large interest in designing midi controllers and synthesizers. I've attached a picture of a quick sketch I did of one part of a midi controller design I'm working on. The problem at hand is this: the two buttons on the face of the part are connected to 2 digital pins on a teensy++ microcontroller. Obviously when you press the button it turns the pin on and when you release it turns it off, I've coded the teensy to increment a variable up or down each time one of the buttons is hit and then send a midi message based on that variable. The question I have now is how would I set up the LED's to light up based on the value set in the variable? Would I have to use 7 analog pins on the teensy for each side of the part? is there some sort of IC component that does the same thing as the code does that I could also connect to the buttons and then connect the LED's to that somehow? There's a limited number of analog pins but I want some sort of indicator of the value of the variable placed on the part itself and the LED thing was all that I could think of. The variable will stay between - 3 and 3.

    Thank you in advance for your help.
     

    Attached Files:

  2. jpanhalt

    jpanhalt

    426
    4
    Nov 12, 2013
    You could do it with 3 pins and read the binary output. You could use just two pins and an up/down counter, or you could do some sort of serial communication with just one pin.The up/down counter might be the simplest.

    John
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-