Kenpilot Posted June 2, 2024 Posted June 2, 2024 I'm trying to use rotary encoders for changing the ILS frequencies in my A10 simpit but apparently they aren't "sensitive" enough? One turn/click changes the frequency too many numbers so to speak. For example, it will go from 108.00 to 110.00 and skip over 109.00, unless I carefully turn the knob and leave it half way in between clicks/detents. I'm using "20 pulse" encoders. Do I need a different encoder or is there something in the arduino sketch that can be changed to make the encoder more sensitive with each turn of the knobs to speak? Thanks! Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
crash test pilot Posted June 2, 2024 Posted June 2, 2024 You may need to use the "two steps per detent" argument. See here: https://github.com/DCS-Skunkworks/dcs-bios-arduino-library/wiki/RotaryEncoder
No1sonuk Posted June 2, 2024 Posted June 2, 2024 To clarify: Put this at the top of your code: typedef DcsBios::RotaryEncoderT<POLL_EVERY_TIME, DcsBios::TWO_STEPS_PER_DETENT> TwoStepRotaryEncoder; // A custom rotary encoder with two quadrature steps per physical detent. Then use "TwoStepRotaryEncoder" in place of the "DcsBios::RotaryEncoder" part of the code lines. e,g, TwoStepRotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", PIN_A, PIN_B); 1
Kenpilot Posted June 2, 2024 Author Posted June 2, 2024 Awesome, thanks so much guys. I'll try this out tonight. Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
Kenpilot Posted June 4, 2024 Author Posted June 4, 2024 It worked! Thanks so much guys!! It's still a little finicky, sometimes the numbers don't change when I turn the knob and I have to turn it once or twice, but its working, I'll just be patient with it. Thanks again!! Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
No1sonuk Posted June 4, 2024 Posted June 4, 2024 (edited) Do you have capacitors on the signal lines? It might help. See attached (the dotted resistors are not required). Edited June 4, 2024 by No1sonuk
Kenpilot Posted June 6, 2024 Author Posted June 6, 2024 On 6/4/2024 at 1:24 PM, No1sonuk said: Do you have capacitors on the signal lines? It might help. See attached (the dotted resistors are not required). I don't have capacitors attached, no, but I'll certainly try it since its still acting weird sometimes. Thanks for the suggestion! Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
Vinc_Vega Posted June 6, 2024 Posted June 6, 2024 You also may use the KY-040 modules, ready made encoders including resistors and capacitors and additional switch. example: https://www.az-delivery.de/en/products/drehimpulsgeber-modul Regards, Vinc Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
No1sonuk Posted June 6, 2024 Posted June 6, 2024 11 hours ago, Vinc_Vega said: You also may use the KY-040 modules, ready made encoders including resistors and capacitors and additional switch. example: https://www.az-delivery.de/en/products/drehimpulsgeber-modul Regards, Vinc They don't have the capacitors.
Kenpilot Posted June 6, 2024 Author Posted June 6, 2024 Those are actually the Rotary Encoders that I'm currently using, the KY-040 style. I do have the ones like the ones in No1sonuk's post. Should I use those instead with the capacitors? I guess it can't hurt to try them with the capacitors. Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
Kenpilot Posted June 15, 2024 Author Posted June 15, 2024 On 6/8/2024 at 12:28 PM, No1sonuk said: You can add capacitors to what you have. The capacitors worked and it's working perfectly. now. Thanks No1sonuk!! 1 Windows 10 ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO intel i7-8700k (Not overclocked) 16 GB Ram EVGA GeForce GTX 108ti SC Black Edition SSD Trackir
Recommended Posts