hrnet940 Posted October 30, 2022 Posted October 30, 2022 (edited) I am having issues with my rotary switches. They are not acting as they should and would like help to get them working correctly. I have attached two videos recorded with my iPad. I have also included the Arduino script with pins 43 - 47 being hooked up to the Mega 2560. I also have the same issue with my Radar switch in the F/A-18C hornet. Any help to get these rotary switches working will be greatly appreciated. Hrnet940 aka Wayne Video_1.MOV Edited October 30, 2022 by hrnet940 Missing information Wayne Wilson AKA: hrnet940 Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.
hrnet940 Posted October 30, 2022 Author Posted October 30, 2022 (edited) Video.MOV Here is the other in-game video. You can see that the switch starts in the SAFE position than is moved fully left, fully right and back to SAFE. I am on the ground with the engines running. Wayne Video.MOV Edited October 30, 2022 by hrnet940 Video not working. Wayne Wilson AKA: hrnet940 Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.
Sting57 Posted October 30, 2022 Posted October 30, 2022 In your Select Jett code, change the numbers 9 to 5. 9 is set there as a default, but you are only using 5 pins Win11 64bit, AMD Ryzen 58003DX, GeForce 3070 8GB, 2TB SSD, 64GB DDR4 RAM at 3200MHz _ full 1:1 FA-18C Cockpit https://www.youtube.com/@TheHornetProject
hrnet940 Posted October 30, 2022 Author Posted October 30, 2022 Thanks, I will and see how that goes. Would this be the same reason why my Radar switch misbehaves too? Thanks, Wayne Wayne Wilson AKA: hrnet940 Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.
Vinc_Vega Posted October 31, 2022 Posted October 31, 2022 (edited) I can't see the radar switch related video. But according your code the Radar_SW is connected to a rotary encoder and not to a rotary switch. Encoders act like increasing or decreasing a value as long as you turn it. Jumps between the steps mostly are caused by encoder bouncing. That means, there are voltage spikes in between two steps of the rotary encoder. Do a search for debouncing a decoder. That can be done by hardware or software filters. Regards, Vinc Edited October 31, 2022 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted October 31, 2022 Posted October 31, 2022 Can you post a picture of the actual rotary switch? If they are like the ones I have, instead of being a 12 position switch they are just four pole three position switches. To explan, when you turn the switch in links position 1, then 2, then 3, then 1, then 2, 3, 1, 2, 3, 1, 2, 3 I modified mine so now they are proper 12 position switches Les
hrnet940 Posted November 7, 2022 Author Posted November 7, 2022 On 10/31/2022 at 4:57 AM, Vinc_Vega said: I can't see the radar switch related video. But according your code the Radar_SW is connected to a rotary encoder and not to a rotary switch. Encoders act like increasing or decreasing a value as long as you turn it. Jumps between the steps mostly are caused by encoder bouncing. That means, there are voltage spikes in between two steps of the rotary encoder. Do a search for debouncing a decoder. That can be done by hardware or software filters. Regards, Vinc Thanks. You are correct that I currently have my Bleed Air, INS and Radar switches hooked up to rotary encoders. I have this done for simplicity and ease of connection to my Arduino's/Mega 2560. I am getting ready to order my panels from TekCreations and getting all of my switches wired up and placed in a container; ready to be installed when they arrive. Wayne Wayne Wilson AKA: hrnet940 Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.
hrnet940 Posted November 7, 2022 Author Posted November 7, 2022 On 10/30/2022 at 6:28 PM, Sting57 said: In your Select Jett code, change the numbers 9 to 5. 9 is set there as a default, but you are only using 5 pins I have made that change and the switch still reacts different. I found that if I slow my transition from one position to the next that it does do as it should. When I look at the switch in the cockpit it goes to the L FUS MSL position as a kinda reset before going to where I have moved the switch too. Strange, but it does work. Is this normal or is there something else that I need to do to get this to work as one would think it should? Wayne Wilson AKA: hrnet940 Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.
eaglewen Posted February 20, 2023 Posted February 20, 2023 Hi Wayne, Did you ever get a solution for this? I also are using rotary switches (not encoders) and when turning them on a regular speed often a position is lost. Turning slowly it works most of the time. Working with a mega2560. Thanks Werner
Enabler Posted May 3, 2023 Posted May 3, 2023 Make this change to your void loop section. Between the correct number of switch positions mentioned above and this debouncing code, it should fix your problems. void loop() { delay(10); } GD ViperWorks - YouTube F-16CM Block 50 Replica Sim Pit Construction
Recommended Posts