Edge event for S3 ? (X9D Plus)

Post Reply
fpvjunkie
Posts: 4
Joined: Fri Jan 30, 2015 1:18 am
Country: -

Edge event for S3 ? (X9D Plus)

Post by fpvjunkie »

The X9D has an open analog input called S3. From what I can tell, it can be used with a switch, pot or 6 position pot. While I'm grateful to have another input available on my 'Plus, I'm wondering if we could take it a step further.

As flight controllers become more sophisticated, they have more and more modes. Users of these devices need a way to select an appropriate mode on their transmitters. While the 6 position pot on S3 is a huge step in the right direction, it could be taken a step further. The 6 pos pot is great but its a bit fiddly, especially when using goggles and its only 6 positions. What happens when the next generation of flight controllers offers 8 different flight modes ?

I have an idea to address this issue - edge event switching, as opposed to position switching as the transmitter uses now.

Lets say we used a 3 position momentary contact switch wired like this for S3.
switch diagram.jpeg
In the normal center position this setup will deliver 2.5V to the S3 input. In the other positions it will deliver 0V and 5V.

If one could capture the event of the user briefly moving the switch to one of the positions, we could increment or decrement a global variable. One could then define a mix based on the value of that global variable. Lets call our global variable FlightMode. Flightmode could hold values of 1 through 8 for 8 different flight modes. Using the switch, the user could toggle through each mode in an up and down fashion.

I feel a switch like this would be much less fiddly than a 6 pos pot.

This switch could also be used for things that work with discrete settings: fligth modes, flap positions, etc.

I've obviously ignored things like overflowing or wrap around on the GV as well as debouncing the switch. I'm sure there are other details that will pop up when actually implementing this.

Is it possible to implement an edge event on the S3 input ? Is it practical to do so ?

I've done some embedded C development if someone will show me the path to implement this ???

User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Edge event for S3 ? (X9D Plus)

Post by Kilrah »

You can already do it, you can detect the presses with 2 logical switches, then use 2 more "Edge" LSs to "extract" the edge event.
fpvjunkie
Posts: 4
Joined: Fri Jan 30, 2015 1:18 am
Country: -

Re: Edge event for S3 ? (X9D Plus)

Post by fpvjunkie »

Thanks.

Post Reply

Return to “openTx for FrSky radios”