running out of pins on the pro micro,just a pin short. can i use the raw pin as a i/o digital pin to a toggle switch ?
Have you used all of the analogue pins ?
So you have no idea what the "raw" pin is?
Not really a problem. Do not try to use it at all!
yes all analog and digital + tx,rx. 4x3 (4 rows,3 colums) matrix, two pins for ignition switch,8(2 each) for 4 on-off-on switches.making a driving sim button box.
haha no,i had'nt even heard about it until i got a arduino.
Why 2 pins for the ignition switch ?
Any reason you cannot make the ignition switch and on-off-on switches part of the matrix?
ignition switch would not be possible since its in game the switch has two different buttons,first two turnings of key hit a different key and the last one hits a different one.Direct connection code for it makes it very easy to get the desired outcome.basically off-electrics-start and similarly backwards.Using the falling edge and rising edge functions of bounce.h gets the perfect outcome.
on-off-n switches i can make a matrix out of them.The problem with the matrix is the keypad code that is inbuilt into the arduino joystick library is a pain to work with for on-off-on switches. I want the on-off-on switches to trigger on the same joystick button. Example : in euro truck sim 2 for which i am building the box,if i want to increase the truck lights are activated by pressing L i need to toggle the same button. So in the up direction from on-off parkinglights begin from off-on they become low beam.Similarly downwards on-off from low beam to trailer lights and from off-on lights turn off. Same for engine brake settings momentary toggle up is brake increase,momentary down is decrease. I want to make it realistic as possible.
what i now realize is one of the on-off-on switches was for windshield wiper speeds i can simply have that as a momentary spst on-off toggle, i have two extra switches in the normal spst 4x3 matrix one of it could be momentary.That could solve the problem. matrix would save me some pinouts though.
its more of a code problem than anything else.Code using bounce library and single switches for on-off-on is very easy.
So write your own code.
Code for a matrix is pretty basic - you hardly need a library for it. I wouldn't use one (but then I wrote serious keyboard matrix code forty years ago! ).
I do not see anything you are doing that could not be implemented using one of the keypad libraries that support n-key rollover.
The ignition switch is basically two switches, nothing that could not be included in a key matrix. You might want to put a check in the code that only allows for ignition after the switch's electrics position has been turned on, but that would likely be unnecessary because it would be mechanically impossible.
i would love to write my own it would be much fun. i had made a post couple of days ago Button matrix using bounce library possible? .
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.