bacon8tor Posted April 24, 2020 Share Posted April 24, 2020 I think I answered my own quesiton going through the posts again. makes sense that a button matrix would be the point to get all the available 256 inputs. But before I spend all that time soldering I am going to work up a fritzing example to make sure I have my head around how to build this matirx correctly using the diagram someone posted in the first few pages. I am not so good at diagrams I am a much more visual person. Again Thanks for everyones responses It is VERY much appreciated. Link to comment Share on other sites More sharing options...
bacon8tor Posted April 24, 2020 Share Posted April 24, 2020 Have I got the right Idea on how this works? Especialy with the on-off-on toggle. i figured an on-Off toggle would be similar to a button. just did a kinda 4x4 matrix. since I didnt want to spend time making a 16x16 if I was doing something incorrect. Link to comment Share on other sites More sharing options...
glynd02 Posted April 24, 2020 Share Posted April 24, 2020 Have I got the right Idea on how this works? Especialy with the on-off-on toggle. i figured an on-Off toggle would be similar to a button. just did a kinda 4x4 matrix. since I didnt want to spend time making a 16x16 if I was doing something incorrect. Hi bacon8tor, not sure about that have not got to the matrix stage yet... Cheers Glyn Link to comment Share on other sites More sharing options...
Sacarino111 Posted April 25, 2020 Share Posted April 25, 2020 Hi, Bacon Glad you mannaged to resolve it! I had the same problem at first: the Mega I bought did not have that pins fo DFU mode, so I had to buy a new (original one) with that feature implemented. Second thing: the matrix you posted looks right, except the fact that the on-off-on will work better if you plug the row to the 21 to 24 pin (the 4 first lines. blue red yellow and black).Otherwise, the button will stay on all the time. These are for"rotary encoders or similar". Besides thar, I think the rest is OK! Again, if I can help, feel free to ask. Saca111 Link to comment Share on other sites More sharing options...
Sacarino111 Posted April 25, 2020 Share Posted April 25, 2020 About the "movement" you said, if you uploaded the sketch to the Arduino with the "axis" option on, you will need to short all the 8 first analog pins (the ones set for the potentiomenters) to ground (in whatever ground pin available). If you don´t plan on using axis, just upload the sketch with the last lines "commented", but with the DFU gate of yours, I would go for connecting all analogs to ground. What you describe is a"ghost effect", from the analog pins. Saca111 Link to comment Share on other sites More sharing options...
Auntystatic Posted April 30, 2020 Share Posted April 30, 2020 after my upload is done I get this, is it normal? thanks F:\Documents\Arduino\ArduinoUSBJoystick-master\arduino\CVP_JoystickController\CVP_JoystickController.ino:16:1: warning: 'typedef' was ignored in this declaration typedef struct joyReport_t { ^~~~~~~ Sketch uses 3526 bytes (1%) of program storage space. Maximum is 253952 bytes. Global variables use 492 bytes (6%) of dynamic memory, leaving 7700 bytes for local variables. Maximum is 8192 bytes. Link to comment Share on other sites More sharing options...
Sacarino111 Posted May 8, 2020 Share Posted May 8, 2020 Hi, Aunty. Actually, I don't remember the messages the arduino IDE gives back after upload, but I don't think it's normal. Did U changed something in the sketch itself? Looks like a " typo"error. This declaration is in the 3d line of the actual sketch, make sure the "{" has it's according "};" three lines underneath. Try downloading again the arduino sketch and upload it again. If not, try a different IDE version, or maybe is a "board uodate" (a function inside the IDE) that has to be done or undone... Anyway, I will be doing a new joystick next week, so I'll be able to check this out. Hope it helped. By. Saca111 Link to comment Share on other sites More sharing options...
Auntystatic Posted May 16, 2020 Share Posted May 16, 2020 Hi Sacarino111 I used the code as is, no changes and I'm using the latest ide, I've tried it on 3 different boards with the same result, hope you can replicate it and come up with a solution :thumbup: Link to comment Share on other sites More sharing options...
Sacarino111 Posted May 17, 2020 Share Posted May 17, 2020 Hi Aunty Maybe the problem is "the latest IDE version". I'll check this on mine, but now I'm a bit out of time (""money") for a test, but I hope that shortly I'll give a try. Cheers. Saca111 Link to comment Share on other sites More sharing options...
Sacarino111 Posted May 17, 2020 Share Posted May 17, 2020 By the way... Does it work? Maybe you got that message but it's working just fine Link to comment Share on other sites More sharing options...
Auntystatic Posted May 18, 2020 Share Posted May 18, 2020 yes it seems to work. I can see it in the windows control panel devices and in properties you can see all the buttons, just need to plug stuff in to test it fully Link to comment Share on other sites More sharing options...
Sacarino111 Posted May 19, 2020 Share Posted May 19, 2020 Well Aunty, not that bad, then! I suggest you forget all about it, as it works, When you get to the stage of plugin buttons and aother stuff, fell free to ask, if needed. Link to comment Share on other sites More sharing options...
Deliverator Posted July 6, 2020 Share Posted July 6, 2020 Hi everyone! First and foremost thanks to overpro for all the info and software! So far I've managed to make the Arduino to work and recognize the button push. I'm a total noob but a friend of mine who knows how to handle electricity will make the matrix for me. I have two questions: 1) Does this software support 3way ON-OFF-ON switches and will I be able to use it as 3 possitions? (let's say for example for the 3 possitions in F18 flaps) 2) Does this software need potentiometers or rotary digital encoder for the axis? I want to use the rotaries for COM volume and a few more things, and I don't know which is the one I need with this software (currently I have in possession rotary digital encoder, but I don't mind ditching them and getting the needed ones) Thanks! Link to comment Share on other sites More sharing options...
Sprool Posted July 10, 2020 Share Posted July 10, 2020 Rotary encoders need a lot more coding to get them working sweetly. They are best used (IMO) as controllers for functions allowing increase/decrease level (instrument lighting, volume level) rather than axes. Pots are easier to use and better suited to axes. DCS allows either/both for many functions. I have wired up 5 on-off-on momentary switches in my buttonbox array, so for any control allowing an up or down increment they work fine, eg: FLIR in Hornet, Dispensor switch, flaps, the middle off button will remain passive with momentary switches which DCS prefers as they are more like standard joystick switches. Link to comment Share on other sites More sharing options...
Deliverator Posted July 13, 2020 Share Posted July 13, 2020 We are using them as increase/decrease for COM volume and such, nothing too fancy so no axes are needed, but I don't know if this software allows the use of digital rotary encoder or not. Also, I know that what you said (On-Off-On) using only the two ON states is already taken into account, but I don't know how could I make the software to read that Off state as a button press Something like: If ON1 and ON2 are off, then virtually press button 2. Link to comment Share on other sites More sharing options...
Sokol1_br Posted July 13, 2020 Share Posted July 13, 2020 Also, I know that what you said (On-Off-On) using only the two ON states is already taken into account, but I don't know how could I make the software to read that Off state as a button press . You can do this editing DCS LUA files, adding commands for OFF state of switches, see pined topic about in this forum section. Or use a 3rd part keymapper software with "key on press" and "key on release", eg. Joystick Gremlin, JoyToKey... BTW - LYNX CUB firmware for (some) Arduino already have this function in the code - send a momentary press in ON and in OFF state of toggle switches, hence don't need additional software, see relatives topics. Link to comment Share on other sites More sharing options...
Sprool Posted July 14, 2020 Share Posted July 14, 2020 We are using them as increase/decrease for COM volume and such, nothing too fancy so no axes are needed, but I don't know if this software allows the use of digital rotary encoder or not. I have 4 rotary encoders now working really nicely, in a matrix wiring button board, using code adapted from a race sim button box build. It all works fine in DCS - 32 buttons, 4 rotaries, but I had to edit the code to work with my Teensy 2.0 board. I'll share the code used if its any use to you, its the only code I managed to give good stable rotary encoder results with. Link to comment Share on other sites More sharing options...
Deliverator Posted July 16, 2020 Share Posted July 16, 2020 You can do this editing DCS LUA files, adding commands for OFF state of switches, see pined topic about in this forum section. Or use a 3rd part keymapper software with "key on press" and "key on release", eg. Joystick Gremlin, JoyToKey... BTW - LYNX CUB firmware for (some) Arduino already have this function in the code - send a momentary press in ON and in OFF state of toggle switches, hence don't need additional software, see relatives topics. THanks for the great answer! I'm afraid that I can't find that pinned post of editing DCS LUA files, I see DCS-BIOS, Helios, etc but nothing about it. I'm interested in that approach so if you don't mind, would you point me in the right direction? I kind of think software was capable of flanking actions editing some lines (I'll check it later tonight) but if neither LUA editing or software editing becomes fruitfull, now I know that Joystick Gremlin or JoyToKey might do the trick! LUNX CUB as far as I could find is not suited for my needs, as it's only prepared for few switches and no rotaries (I have a total of 14 3 position switches, 2 buttons and 5 rotary encoders) but I'll check the .ino to see if there's something I can use from it I have 4 rotary encoders now working really nicely, in a matrix wiring button board, using code adapted from a race sim button box build. It all works fine in DCS - 32 buttons, 4 rotaries, but I had to edit the code to work with my Teensy 2.0 board. I'll share the code used if its any use to you, its the only code I managed to give good stable rotary encoder results with. Thans for the offering!! It might be one solution to just scrap the Mega board and go with another one as long as it's with is no larger than mega one or I'll just have to re-design everything. My needs are: - 14 Switches (so equivalent to 28 buttons there) - 2 Buttons - 5 Rotary digital encoders with push function (so a total of 15 buttons I guess?) That means I need a total of 45 connections for all my needs I guess? My friend is the one who knows how the electricity and electronic part works but he's been too busy last week with work for us to speak about this little proyect of ours, that's why we went with Mega board... but maybe I'm missing something out and I can use either the same Teensy board as you or other option. If you think that your board and with that firmware/software is what I need, I would be really grateful for your help! :) Link to comment Share on other sites More sharing options...
Sprool Posted July 18, 2020 Share Posted July 18, 2020 My bad-the info to edit is not dcs lua but in E:\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\Ka-50\Input\ka-50\joystick\default.lua file. (Obv. example for KA-50 module) The Teensy board (and Micro Pro) are tiny, 35 x 18mm so should give you no issues with limited space. The coding works using a button matrix, so if you want 32 switches you dont need 32 separate wires and one ground, you arrange the switches in rows and columns like a keyboard is wired, 6 columns and 5 rows gives you 30 buttons and you only need a wire for each row and each column; 6 + 5 = 11. The youtube build video explains it really well. Link to comment Share on other sites More sharing options...
Sokol1_br Posted July 18, 2020 Share Posted July 18, 2020 I'm afraid that I can't find that pinned post of editing DCS LUA files, This topic give you the principles, editing P-51 LUA files for match ON-OFF-ON switches. https://forums.eagle.ru/showthread.php?t=89226 Link to comment Share on other sites More sharing options...
Sacarino111 Posted July 20, 2020 Share Posted July 20, 2020 Hi, Deliverator. Your needs are perfectly reachable with Overpro's CVP Joystick. Indeed, you ll have a lot of non used buttons or joy axes free! Give me some time and I ll try to do a Fritzing example for your needs. Cheers, Saca111 Link to comment Share on other sites More sharing options...
Sacarino111 Posted July 20, 2020 Share Posted July 20, 2020 Hi again Deliverator. I made a fast schematic on how I vould connect the gear you want. Take not that I haven't put all the switches nor the rotarys, I made an example on how they should go... Also: * I suggest you connect all the "columns" via a diode (1N4148), with the negative( the side with the strip) pointing towards the button, not the board. 1 Diode per button. Consider the extrem connections of the switches/rotarys a button. * Set as much "Rows" an "column" buttons in serial as you can, so you will save a lot on wiring, and that's is a good advice, believe me! * In the example, I only connected the bare minimum for your needs. For more connections, simply follow the logic of the circuit. If you don't see the logic, just tell me and Il be glad to help. Link to comment Share on other sites More sharing options...
Sacarino111 Posted July 20, 2020 Share Posted July 20, 2020 Sorry, can't manage to insert a picture! working on it! Link to comment Share on other sites More sharing options...
Sacarino111 Posted July 20, 2020 Share Posted July 20, 2020 https://drive.google.com/file/d/1NLfTzMqB_oOVeVPxCqS1s6R1qJUF1UUc/view?usp=sharing Link to comment Share on other sites More sharing options...
Auntystatic Posted July 20, 2020 Share Posted July 20, 2020 access denied Link to comment Share on other sites More sharing options...
Recommended Posts