Extra inputs for Devo Tx's

More
11 Sep 2015 12:43 #37658 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
What are you guys using the momentary buttons for? I don't have any installed but I was thinking I'd like to use one for an "oh crap" button. I was thinking it could work by temporary sending whatever value on whatever channel that the flight switch is on (temporarily changing it back to angle mode but ONLY while the switch is held).
Is that something possible? What are you using the switches for?

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/

Please Log in or Create an account to join the conversation.

More
11 Sep 2015 16:21 - 11 Sep 2015 16:37 #37663 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
Momentary switches can be useful for a lot of things. Most of the small video quad ini's use a trim switch to turn on/off the video or to snap a photo. Some use them for auto-flip. You could certainly assign one to "Safe" mode or whatever (in my Blade 200srx, channel 6 is used for that).

For the switches we've added in this thread, they are a PPM input, and through the magic of DevoTX you can assign the switch to ANY channel on your bird. So if I set up my Arduino PPM channel 1 for a momentary switch, I would set up my mixer for channel 6 to use PPM1 as the SRC, use default 1-to-1 curve, default scale of 100. Then when I press the switch, the value on Channel 6 goes to max and I get Safe mode until I release. Unfortunately I haven't figured out how to use PPM input in the emulator :(
[channel6]
max=100
min=-100
template=simple
[mixer]
src=PPM1
dest=Ch6

I can't test this code because I've set all my momentary switches up in analog on my Arduino; it works with my 3-way switches just fine. So please let me know if this doesn't work for you.

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!
Last edit: 11 Sep 2015 16:37 by Deal57. Reason: Disclaimer: YMMV

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 04:54 #37669 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's

davidwyl wrote: thanks for the code :) but i cant seem to compile it.
here is the error i got.
"collect2.exe: error: ld returned 5 exit status
Error compiling."


BTW can u explain how to use virtual channels to use that 3ways switch to control dual rate?
thanks

I've got no idea on the compiling error. I edited the code a couple times, right after posting, I noticed a few syntax errors. Did you copy it within 10 minutes or so of the original post?

For rates, you should actually be fine with the original setup. Deviation's Dual Rate/Expo mixer only requires 2 switch positions to select mid & low, high is default if otherwise. So just set the switch for Mid to PPM3 (or PPM4) and the switch for Low to !PPM3 (or !PPM4).
It should work,.............I think.

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 05:09 #37671 by davidwyl
Replied by davidwyl on topic Extra inputs for Devo Tx's

Epyon wrote: I've got no idea on the compiling error. I edited the code a couple times, right after posting, I noticed a few syntax errors. Did you copy it within 10 minutes or so of the original post?

For rates, you should actually be fine with the original setup. Deviation's Dual Rate/Expo mixer only requires 2 switch positions to select mid & low, high is default if otherwise. So just set the switch for Mid to PPM3 (or PPM4) and the switch for Low to !PPM3 (or !PPM4).
It should work,.............I think.

tried copy many times and compile but till same error. my programming skill is limited, to couldn't figure out what went wrong.
will try to do that PPM3 & !PPM3 setup and see. (still learning how to use deviationTX)

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 08:11 #37674 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's
Which board did you compile it for, the Mini or Nano? Was the IDE set to the right board?

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 08:34 #37676 by davidwyl
Replied by davidwyl on topic Extra inputs for Devo Tx's

Epyon wrote: Which board did you compile it for, the Mini or Nano? Was the IDE set to the right board?

i compile if for Nano.
tried compile it for nano & mini both also same error

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 09:04 #37679 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's
Give this a try. Compiled for Nano.
Attachments:

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 09:31 #37681 by davidwyl
Replied by davidwyl on topic Extra inputs for Devo Tx's
google around and found out it is something to do with arduino software & windows xp.
compile using windows 10 , everything run perfectly.
Your code run perfectly :) :) ...my mistake for still using windows XP :lol:

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 11:39 - 12 Sep 2015 11:43 #37682 by aMax
Replied by aMax on topic Extra inputs for Devo Tx's
:whistle: .... IDE 1.0.6 and 1.6.1 still running fine with XP.
My advice, especially for those who are doing much technical stuff, preserve at least one of your previous OS as dual boot....

Devo7e, TaranisQ X7, R9M , 4in1 MM, Futaba FC18plusV3.2 & DFT/FLD-02
Last edit: 12 Sep 2015 11:43 by aMax.

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 13:03 #37683 by davidwyl
Replied by davidwyl on topic Extra inputs for Devo Tx's

Epyon wrote:
For rates, you should actually be fine with the original setup. Deviation's Dual Rate/Expo mixer only requires 2 switch positions to select mid & low, high is default if otherwise. So just set the switch for Mid to PPM3 (or PPM4) and the switch for Low to !PPM3 (or !PPM4).
It should work,.............I think.

tried this but does not work. set !ppm3 70%, ppm3 30% and the high rate is 100%. when i flick the switch it will toggle between 70% and 30% but never go to 100%.

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 18:39 #37695 by mwm
Replied by mwm on topic Extra inputs for Devo Tx's

davidwyl wrote:

Epyon wrote:
For rates, you should actually be fine with the original setup. Deviation's Dual Rate/Expo mixer only requires 2 switch positions to select mid & low, high is default if otherwise. So just set the switch for Mid to PPM3 (or PPM4) and the switch for Low to !PPM3 (or !PPM4).
It should work,.............I think.

tried this but does not work. set !ppm3 70%, ppm3 30% and the high rate is 100%. when i flick the switch it will toggle between 70% and 30% but never go to 100%.


That's because you only get the default mode if both switches are off. If the two switches are PPM3 and !PPM3, clearly one of them is always on. You needed to use two channels for this.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 18:43 #37696 by mwm
Replied by mwm on topic Extra inputs for Devo Tx's

Cereal_Killer wrote: What are you guys using the momentary buttons for?


Just for the record, you can use the existing trim switches and left/right/up/down/exit buttons as momentary buttons without adding a hardware. As noted, they get used for camera control and flip mode on toy grade quads (I'd hardly call my V323 "small"). I tend to use a switch for flip mode. I also use one for mode control on my NanoQX.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 22:21 #37700 by Richard96816
Replied by Richard96816 on topic Extra inputs for Devo Tx's

mwm wrote:

Cereal_Killer wrote: What are you guys using the momentary buttons for?


Just for the record, you can use the existing trim switches and left/right/up/down/exit buttons as momentary buttons without adding a hardware. As noted, they get used for camera control and flip mode on toy grade quads (I'd hardly call my V323 "small"). I tend to use a switch for flip mode. I also use one for mode control on my NanoQX.


I've been on the fence for a bit now. Trying to figure out how to disfigure one of my 7e's. I have flip on a switch for most of my quad collection. Pardon my French, but It sucks! So I seldom do flips. Auto-flip mode is a nasty accident waiting to happen, and flipping a switch back and forth is not much better. The otherwise awful toy radios come with wonderful little buttons, positioned right where they belong -- under your index fingers. (Thumb flier.) Someone recently posted a photo (can't find it just now) of his added button on the shoulder of his 7e. That's wonderful, easy. Mandatory. :-) The 7e shoulders deserve several momentary pushbuttons. And deserving pilots should have them available. Good stuff. Probably the most important upgrade for those with collections of toy quads. After Deviation itself, of course.

(Stuff is hard to find on this site. Not so well organized or instrumented. It could use some help. Especially a smarter, google-style, search.

A rating system for posts might not be bad either. Then posts that people liked a lot could be brought up first in searches. Add power to the gold-mine of information collected here.)

Please Log in or Create an account to join the conversation.

More
12 Sep 2015 23:42 - 12 Sep 2015 23:51 #37703 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's

mwm wrote: That's because you only get the default mode if both switches are off. If the two switches are PPM3 and !PPM3, clearly one of them is always on. You needed to use two channels for this.

Crud, so if switch is -100, would it have to go to +100 to be considered off or just to the positive side (+1)?

Richard96816 wrote: I've been on the fence for a bit now. Trying to figure out how to disfigure one of my 7e's. I have flip on a switch for most of my quad collection. Pardon my French, but It sucks! So I seldom do flips. Auto-flip mode is a nasty accident waiting to happen, and flipping a switch back and forth is not much better. The otherwise awful toy radios come with wonderful little buttons, positioned right where they belong -- under your index fingers. (Thumb flier.) Someone recently posted a photo (can't find it just now) of his added button on the shoulder of his 7e. That's wonderful, easy. Mandatory. :-) The 7e shoulders deserve several momentary pushbuttons. And deserving pilots should have them available. Good stuff. Probably the most important upgrade for those with collections of toy quads. After Deviation itself, of course.


Easiest way is to parallel a momentary or two off of your throttle trim buttons. Or if you happen to have a 2 pin JST connector you can plug your new buttons in place of the trims.
I personally would add an Arduino and a bazillion switches, just sayin. :lol:
Last edit: 12 Sep 2015 23:51 by Epyon.

Please Log in or Create an account to join the conversation.

More
13 Sep 2015 01:24 #37704 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
A momentary switch wired in parallel to the FMode switch would be easy to add and fit nicely on the right shoulder of the 7e. I have several models that use the FMode for flip mode, and my Blade Safe switch would work better with a momentary button too. This wouldn't need an Arduino. For $1.77 a pair at BG I'm in.

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!

Please Log in or Create an account to join the conversation.

More
13 Sep 2015 15:50 #37717 by davidwyl
Replied by davidwyl on topic Extra inputs for Devo Tx's

mwm wrote: That's because you only get the default mode if both switches are off. If the two switches are PPM3 and !PPM3, clearly one of them is always on. You needed to use two channels for this.

So is it a way to set -100,0,+100 3ways switch as a dual rate switch (ie: 100%, 70%, 50%)??

Please Log in or Create an account to join the conversation.

More
13 Sep 2015 19:32 #37729 by mwm
Replied by mwm on topic Extra inputs for Devo Tx's
There are no -100,0,100 switches in deviation. A switch is either on (1 or more) of off (-1 or less, and I never do remember which 0 is). A three position switch is three switches in the firmware, like FMODE0, FMODE1 and FMODE2 that are all either on our off.

So to use a 3 position switch for 3 flight modes, you use two of those three switches for two rates and the third position is your default.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
13 Sep 2015 20:06 #37731 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's
Just tried setting up one of my Arduino-connected 3-ways for dual rate. In the 0 position it fluttered between mid & low.

davidwyl, have you tried the code that split the 3-ways into six 2-ways? You'll end up with PPM3,4, & 5 as the 3 positions of one switch. Just set Mid to PPM3 or 5, and Low to PPM5 or 3. The middle, PPM4 won't be used. Well, you could set PPM4 as a switch for something you want active along with High rates.

Please Log in or Create an account to join the conversation.

More
13 Sep 2015 20:24 - 13 Sep 2015 20:34 #37733 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
In your code when you test the two digital pins of the three-way switch, I noticed that you are doing redundant testing, which, IMHO, may be the source of the fiddly results. Here's what I mean:

Your code tests Pin 2 for ==0, and if true assigns the PPM value for low. If the result is FALSE, you test for the state of Pin 2 and Pin 3, but this is not needed, because we already know Pin 2 is on, and if Pin 2 is on, Pin 3 cannot be on (on a 3-way On-Off-On switch). Here's the code:
// 3-way switch #1
  // Position 1
  if (digitalRead(inPinD2) == 0) {
           sw1_uS = 750;
  } else {
           sw1_uS = 1625;
 }
  // Position 2
  if ((digitalRead(inPinD2) == 1) && (digitalRead(inPinD3) == 1)) {
           sw2_uS = 750;
  } else {
           sw2_uS = 1625;
 }
  // Position 3
if (digitalRead(inPinD3) == 0) {
           sw3_uS = 750;
  } else {
           sw3_uS = 1625; 
 }

In my code I am setting the pins HIGH, then when the switch goes on it is grounded, so the value goes to 0. Once you test the state of Pin 2, you have only two possibilities for Pin 3. So my code tests to see if Pin 2 is NOT ON, which if TRUE, means it's off and we do not need to test Pin 3. If it is FALSE, we know Pin 2 is ON, and we need to find the state of Pin 3. I think if you simplify the code you'll make the jitters go away:
if (digitalRead(swPin_D1) != 1) { // 3-way Switch 1
           sw1_uS = pulseMin;
  } else {
           if (digitalRead(swPin_D2) != 1 ) {
            sw1_uS = pulseMax;
  }        else {
            sw1_uS = pulseMid;
            }
  }

I don't know if this helps your particular installation, but I'm not having any issues with the two 3-way switches, one assigned to PPM1 (-100, 0, 100) and one assigned to PPM2 (-100,0,100).

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!
Last edit: 13 Sep 2015 20:34 by Deal57. Reason: Upside down logic!

Please Log in or Create an account to join the conversation.

More
13 Sep 2015 21:17 #37735 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's
Excellent point, Deal57. Yeah I've got a lot of cleaning up/simplifying to do. Thanks.

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum