Hi all,
I’m looking for help on how to make a HID with some specific control function. The device is supposed to control functions on Digital Combat Simulator.
For my specific device I have the following constraints:
3x potentiometer, with one pot functionally limited to 90 degrees (it can rotate further, but I want it to linearly reach the max over the first 90 degrees of rotation).
2x rotary encoder. The encoders are basic ones without pcb (installation space constraint), so I will only use pin A, pin B, and the Gnd pin. Any pull-up resistors would have to be activated internally to the arduino.
1x (on)-off-(on) switch, with both (on) positions wired to a unique pin, and no function for the off position (I.e. not wired).
Debounce through software for switch and rotary encoders.
I asked AI to help me get a code for this, but apparently others believe the sketch created by AI is inconsistent. It also doesn’t work ( not sure if that’s because of pins 0 and 1 being used for one encoder. I was told I cannot use pins 0 and 1.). Happy to share that ode if someone is interested and believes it’s a good starting point.
Now I’m an absolute noob when it comes to programming and how electronic components might affect that programming, but rather than have someone give me the code, I’d like to learn how to come up with the right code.
So I was thinking, if someone can teach me the building blocks, and I then mix and match those for my device, that way maybe I learn to do this independently myself.
E.g. if someone can tell me how to programme a single rotary encoder, how to programme a single switch, and a single potentiometer, maybe enhanced with how to ramp the range within 90 degrees, then I imagine I can work out at least for this device the whole thing myself.
There may be constraints to pin usage for pots, rotary encoders, and/or switches/buttons. I’d love to hear about those too.
As a note, I cannot find good tutorials for what I want, either here, on google or YouTube, hence my request here.
Many thanks in advance!
