Hello,
I have searched the forums but couldnt find the answer to my question (or I wasn't able to word it correctly in the search!).
A long story short, I am building my own switch panel for simulators.
I have it built using a matrix. I'm using the arduino pro micro (unbranded eBay special).
I have the joystick working, and all the switches are triggering the correct keys in the matrix (checked using Joystick Show). So, the hardware side of things is not the issue i'm facing.
However, I'm trying to modify the code so that I can trigger keys by a switch being (or not being) in one position or another.
For example. there are a mixture of "on-off" and "on-off-on" switches on the board.
For the simulator, I need to be able to send the 'off' position as a trigger.
So, an "on-off" switch will currently trigger one key, on or off. But I need it to be able to trigger one key if it's on, and another if it's off. The same for a "on-off-on" switch.
I have attached a picture of my matrix plan to try and explain what I mean.
The items written in black are the physical switch connections, and the items written in green are the triggers I want to happen when a switch is in the "off" position.
So far, I've written various lines of code that I thought would work, but I can't quite seem to get it.
I've tried placing this into the code where I thought it makes sense, but nothing seems to work.
Where I place it doesnt break the code, and the joystick will still operate as normal, it just doesn't perform the function that I need. I get no errors from the complier when I verify.
Here is the whole code to see what's going on (attached as text document due to character limit for the post).
(Also note, that I have adapated this code from someone elses example, so the main joystick code is not my own, only the adaptions).
I hope this all makes sense, and if I can clarify or explain anythign further, please let me know.
Thank you in advance!
code.txt (9.11 KB)