Extra inputs for Devo Tx's
- Cereal_Killer
- Offline
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.
- Deal57
- Offline
- Posts: 857
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!!
Please Log in or Create an account to join the conversation.
- Epyon
- Offline
- Posts: 57
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?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
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.
- davidwyl
- Offline
- Posts: 26
tried copy many times and compile but till same error. my programming skill is limited, to couldn't figure out what went wrong.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.
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.
- Epyon
- Offline
- Posts: 57
Please Log in or Create an account to join the conversation.
- davidwyl
- Offline
- Posts: 26
i compile if for Nano.Epyon wrote: Which board did you compile it for, the Mini or Nano? Was the IDE set to the right board?
tried compile it for nano & mini both also same error
Please Log in or Create an account to join the conversation.
- Epyon
- Offline
- Posts: 57
Please Log in or Create an account to join the conversation.
- davidwyl
- Offline
- Posts: 26
compile using windows 10 , everything run perfectly.
Your code run perfectly ...my mistake for still using windows XP
Please Log in or Create an account to join the conversation.
- aMax
- Offline
- Posts: 776
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
Please Log in or Create an account to join the conversation.
- davidwyl
- Offline
- Posts: 26
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%.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.
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
davidwyl wrote:
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%.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.
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.
- mwm
- Topic Author
- Offline
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.
- Richard96816
- Offline
- Posts: 208
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.
- Epyon
- Offline
- Posts: 57
Crud, so if switch is -100, would it have to go to +100 to be considered off or just to the positive side (+1)?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.
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.
Please Log in or Create an account to join the conversation.
- Deal57
- Offline
- Posts: 857
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.
- davidwyl
- Offline
- Posts: 26
So is it a way to set -100,0,+100 3ways switch as a dual rate switch (ie: 100%, 70%, 50%)??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.
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
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.
- Epyon
- Offline
- Posts: 57
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.
- Deal57
- Offline
- Posts: 857
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!!
Please Log in or Create an account to join the conversation.
- Epyon
- Offline
- Posts: 57
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Extra inputs for Devo Tx's