Back with a smaller update.
Controlling LEDs with joystickbuttons turns out to be quite the job. A little recap of what I did and had to abandon again.
At first I thought it'll be enough to get a wire to the respective row pins, but that didn't work. Reason: the matrix works with pulses (are to be found within in the code) not with the much simpler but slower voltage changes. Reason being that the chip is able to poll the whole matrix several times per millisecond when using pulses. For those who are interested in that, I'll have short explanation at the end of this post. Finding out the matrix or the so called event listener works with pulses inhibited me from using any further hardware solution for example transistors in order to get my LEDs working when the intended buttons are pushed.
@Mike: maybe you can enlighten me. I thought I can use the exact pin 'location' of each switch by the coordinates of rowPins and columnPins. Each time a Button is pressed, at least 2 specific pins used for the matrix are pulled to ground due to the pulses. That is the moment, the eventlistener implemented into the code registers a buttonpress and forwards that to the usb/pc. My idea was to use these coordinates to control my LED states similar to 'if pinColumnXYZ and pinRowXYZ are LOW, change LEDstate' (simplified so everyone can follow me here, if I have a working code I'll post that, ofcourse). Do you know of any way, to use the already built in eventlistener or do i have to write one myself and connect that to the existing code? Thanks for your answer in advance.
Cheers, Paul
P.S.: for those interested: The buttonmatrix consists of rows and pins, as shown in Mike's earlier posts. Each button terminal is attached to one 'row' and one 'column'. Theoretically, you can do any number of rows combined with any number of columns, as long as these can connect to your controllerboard. The benefit is that you can work 80 buttons (for Mike's example) with only 18 pins in total. If you wired each pin conventionally to each switch you'd need at least 80 pins, and that is a HUGE board. But i'm trailing off. By having all buttons arranged in a matrix where some are connected to rows and some to columns, you could easily distinguish each button. Basic state for colums AND rows is HIGH. Now if both pins are HIGH, how does the Teensy read a button press? The teensy sets the columns to a LOW pulse. One after the other. That happens so fast, that virtually it happens simultaneously on all column pins. If a button is pressed, while the LOW pulse is on the same column as pressed button, the teensy registers a LOW state and thus registers a buttonpress. As mentioned before this happens so fast, virutally all buttonpresses and even simultaneous buttonpresses are registered at same time, although technically one after the other. That speed of the LOW pulses is the problem I ran into when trying to hook in a 'listeneing' wire physically. It just doesn't work that way without the proper routine.