overpro Posted November 6, 2015 Author Share Posted November 6, 2015 Is it possible to use a simple ON-OFF switch to open the headlights or i must use toggle switch? can you please post a picture of the wiring design? by using http://fritzing.org/ or whatever tools you prefer overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro Link to comment Share on other sites More sharing options...
Maximvs Posted November 6, 2015 Share Posted November 6, 2015 (edited) I use this on/off switch.Have 2 pols.I connect it on pin 38 and 41.When it is in On position lights the 99 button if i remember well.But in the game must return to Off position to execute the command.Can this type of switches works with Joystick?.I want to ON the headlights. Thank you for help! Send from my mobile Edited November 6, 2015 by Maximvs Link to comment Share on other sites More sharing options...
overpro Posted November 6, 2015 Author Share Posted November 6, 2015 I use this on/off switch.Have 2 pols.I connect it on pin 38 and 41.When it is in On position lights the 99 button if i remember well.But in the game must return to Off position to execute the command.Can this type of switches works with Joystick?.I want to ON the headlights. Thank you for help! Send from my mobile Is it DCSW A10C or something else? if the game only recognize the edge triggered signals instead of level triggered signal then the arduino code need some rework. the current arduino code only works as level triggered:flip to On always make the button as On. There are other types such as rising edge triggered: flip from off to on will generate a Button On pulse, falling edge triggered: flip from on to off will generate a Button On pulse, rising/falling edge triggered: flip from off to on or on to off will both generate a pulse. Refer to post #99 to rewrite the button logic if you want to implement edge triggered type. http://forums.eagle.ru/showpost.php?p=2299483&postcount=99 I 'm confused on the last question, I think we are talking about the joystick right now. So what do you mean by “using this toggle switch with Joystick”? overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro Link to comment Share on other sites More sharing options...
Maximvs Posted November 6, 2015 Share Posted November 6, 2015 (edited) For the last question i mean if this ON/OFF switch can work with your joystick code. This is not a toggle switch.Is just ON - OFF position and as i can think it's not generate a pulse,right?I can't rework the code cause i don't know how to do it Overpro. Thank you for your answer and i will use a toggle switch with ON-OFF-ON positions.I use this and works perfect. Edited November 6, 2015 by Maximvs Link to comment Share on other sites More sharing options...
Nikolas_A Posted November 6, 2015 Share Posted November 6, 2015 I think you got the definition of "toggle" wrong. It has nothing to do with sending a pulse. For the last question i mean if this ON/OFF switch can work with your joystick code. This is not a toggle switch.Is just ON - OFF position and as i can think it's not generate a pulse,right? Link to comment Share on other sites More sharing options...
Maximvs Posted November 6, 2015 Share Posted November 6, 2015 sorry....you are right!...i mean that the toggle switch goes to ON and return to OFF , so the command is ok....this switch that i try do the "half" of the command....must goes from ON to OFF manually,so i can't use it....if there is a solution i will be glad to tell me. Link to comment Share on other sites More sharing options...
Nikolas_A Posted November 7, 2015 Share Posted November 7, 2015 Ah, ok. I see you mean a momentary switch. I'm not familiar with the Arduino HID controller, but I guess it's similar to Leo Bodnar's BU0836A. When you use a momentary switch, in Windows game controlers screen you can see a button turn on. You let go of the switch and it goes off. In some controllers (I use PHCC) you can specify a command when an input is On, and a different command when it goes Off. In BU0836 (And I guess Arduino HID, since you're having that problem) you can't do that. You can, however, use software to do that. I've go to look in my bookmarks, but I remember at least two apps where you could write a scrip that e.g. sends a keyboard command when a joystick button goes on and a different when it goes off. HTH sorry....you are right!...i mean that the toggle switch goes to ON and return to OFF , so the command is ok....this switch that i try do the "half" of the command....must goes from ON to OFF manually,so i can't use it....if there is a solution i will be glad to tell me. Link to comment Share on other sites More sharing options...
Maximvs Posted November 7, 2015 Share Posted November 7, 2015 Thank you very much Nikolas.I will wait for your apps. Link to comment Share on other sites More sharing options...
Maximvs Posted November 8, 2015 Share Posted November 8, 2015 Αnother question.can i light up a led when i use a toggle switch,For example : When i "open" the toggle switch , a led will light and remember it until i use the same toggle switch? Link to comment Share on other sites More sharing options...
Maximvs Posted November 9, 2015 Share Posted November 9, 2015 So...this is my simracing panel..thank you very much for your help...Works perfect with 2 arduinos.One for buttons and rotaries and one for data displays. Link to comment Share on other sites More sharing options...
Nikolas_A Posted November 9, 2015 Share Posted November 9, 2015 One is AutoHotkey, I'm still searching for the other. It would be better to start a new thread for your questions though, instead of cluttering this one... Thank you very much Nikolas.I will wait for your apps. Link to comment Share on other sites More sharing options...
TripleSeven Posted December 22, 2015 Share Posted December 22, 2015 (edited) Wanted to share my pain in connecting the ARDUINO 16U2 chip to the USBASB (usbasp thomas fischl) in order to flash the firmware. If you look at that device you will find the proper pin out http://www.dx.com/p/10-pin-to-6-pin-adapter-board-for-avrisp-usbasp-stk500-black-blue-225135 and you will be able to match it to the board http://forum.arduino.cc/index.php?topic=125908.0 When trying to communicate using AVRDUDE (under linux or windows) you will have a message like "USB ASP firmware needs to be updated" = False, it is most probably because the wiring is incorrect (10 to 6 pins) Edited January 3, 2016 by TripleSeven Link to comment Share on other sites More sharing options...
TripleSeven Posted January 3, 2016 Share Posted January 3, 2016 (edited) Good day, For those willing to use only 32 buttons (pin 22 to 53) I ve made some more compact code. You need to use momentary switch or ON OFF switches, OFF = closed circuit, ON = open circuit (used the internal pull up). Debounce is done by the driver so no need to change code for that. You need to perform steps as described at the beginning of the post and my previous post if you need to reprogramm the 16U2 because mine refused to go into DFU mode. I m building a panel for the Su-27 with engine start/stop, avionics, autopilot, ECM with corresponding LEDs. More code to come. Note that the original code is not compliant with most of the software best practices and it needs to be reworked but at least it is cleaner. Have fun.JoystickGrand.zip Edited January 3, 2016 by TripleSeven Link to comment Share on other sites More sharing options...
Maximvs Posted February 25, 2016 Share Posted February 25, 2016 Hello all, is it possible to use some leds to light when a button is on?.. thank you! Link to comment Share on other sites More sharing options...
sniperwolfpk5 Posted February 26, 2016 Share Posted February 26, 2016 yes Win10, Intel 3rd Gen. Core i7 3.8Ghz, 20GB ram, Nvidia Geforce 1060 6GB Opentrack (Download it from HERE), PS3 Eye, Saitek x52-pro Joystick, DIY Rudder Pedals, Google Cardboard with DCS World English is not my native language Link to comment Share on other sites More sharing options...
RightStuff Posted February 26, 2016 Share Posted February 26, 2016 The easiest way for switches is to 'cheat' by using a 2pol. switch. For buttons it would be a little more tricky. Something with Flip-Flop pops up in my mind. But that must not be the best solution. Link to comment Share on other sites More sharing options...
Hollywood_315 Posted February 26, 2016 Share Posted February 26, 2016 I just discovered this little tool and managed to get it to work without issue. Big props to overpro! So I now have two new devices in Windows, both are called 'C.V.P Joystick'. Anybody know a trick how to rename them? There is no spoon. VAICOM PRO plugin for DCS World www.vaicompro.com Link to comment Share on other sites More sharing options...
Maximvs Posted February 26, 2016 Share Posted February 26, 2016 The easiest way for switches is to 'cheat' by using a 2pol. switch. For buttons it would be a little more tricky. Something with Flip-Flop pops up in my mind. But that must not be the best solution. yes....very clever trick !!....i want for On-Off switches....i try it!!...thank you!! Link to comment Share on other sites More sharing options...
kuabi Posted February 29, 2016 Share Posted February 29, 2016 analog mini joystick Hi to all and a big thanks to overpro for this great solution for a button box. Came across this yesterday and have managed to suss out the matrix and have got a button and a rotary encoder working without problems. I have tried a mini joystick on the analog ports but the vertical pot seems to be faulty so have ordered another. It comes with v+, Keypush (button,) vertical, horizontal, and gnd pins which is straight forward but how would I share the gnd with the button when using it in the matrix? I also have a pcb mounted encoder with button which also shares a single gnd. Hope my question is clear and many thanks in advance for a solution. intel i7 6700k overclocked to 4.6, 16GB DDR4 3200MHz, Asus z170 pro gaming motherboard, Asus strix 1080, Max flight stick(modded), MFG Crosswind pedals. Link to comment Share on other sites More sharing options...
kuabi Posted March 3, 2016 Share Posted March 3, 2016 Thumb stick As an update to my last post I have now received a new thumb stick which seems to work ok though i'm still having trouble getting the select button to work properly. When the button is depressed i'm getting what seems to be the first button of each matrix row light, ie: 1, 17, 33, 49 etc.. Any help on this would be appreciated. intel i7 6700k overclocked to 4.6, 16GB DDR4 3200MHz, Asus z170 pro gaming motherboard, Asus strix 1080, Max flight stick(modded), MFG Crosswind pedals. Link to comment Share on other sites More sharing options...
Dropship Pilot Posted March 3, 2016 Share Posted March 3, 2016 Have a look at post #8. You need to include the diode(s) in the correct orientation to prevent the ghosting effect. DSP Link to comment Share on other sites More sharing options...
kuabi Posted March 3, 2016 Share Posted March 3, 2016 Thanks DSP. I'll have a proper look tomorrow. Looking at the matrix diagram, am I right in thinking that the column (38) will have the diode in which the cathode will go to the gnd wire of the switch (which will also be to gnd on the arduino as the thumb stick needs the gnd) and the row (28) will have a direct connection to the select wire of the switch? intel i7 6700k overclocked to 4.6, 16GB DDR4 3200MHz, Asus z170 pro gaming motherboard, Asus strix 1080, Max flight stick(modded), MFG Crosswind pedals. Link to comment Share on other sites More sharing options...
Dropship Pilot Posted March 3, 2016 Share Posted March 3, 2016 Actually, the button should have no ground connection - it should be connected to a row and via the diode to a colum pin (see post#1 for those pins). Cheers, DSP Link to comment Share on other sites More sharing options...
kuabi Posted March 4, 2016 Share Posted March 4, 2016 (edited) I'm still getting ghosting. The problem seems to be is that the thumb stick needs the gnd wire to have a connection to gnd to work which then just leaves the one wire (select) to connect to the matrix. so I have row(pin 28) connected to the select wire, which is then connected via a diode to the column(pin 42). The cathode of the diode is towards the switch. If I reverse the diode I get nothing. Edited March 4, 2016 by kuabi Added diagram intel i7 6700k overclocked to 4.6, 16GB DDR4 3200MHz, Asus z170 pro gaming motherboard, Asus strix 1080, Max flight stick(modded), MFG Crosswind pedals. Link to comment Share on other sites More sharing options...
Dropship Pilot Posted March 4, 2016 Share Posted March 4, 2016 The button matrix won't work (properly) if there's a ground connection. To make the button work you need to cut the ground connection to the button on the PCB (i.g. the button is isolated from the pots). Then you can connect it to the row and column pins (don't forget the diode) and everything should work as expected. DSP Link to comment Share on other sites More sharing options...
Recommended Posts