Thread Tools
May 18, 2019, 08:45 AM
Registered User
Thread OP
Discussion

Splitting a channel into several functions


Using one channel to give you multiple digital switches with an Arduino Nano
PWM to several digital (1 min 58 sec)



int pin = 6; // Check what pin to use
int low = 10; // LED pin low
int med = 11; // LED pin med
int high = 12; // LED pin high
int duration; // Duration of the pulse


void setup()
{

pinMode(pin, INPUT);
pinMode(low, OUTPUT);
pinMode(med, OUTPUT);
pinMode(high, OUTPUT);
}



void loop()
{

duration = pulseIn(pin, HIGH);
if (duration > 1100 && duration <1300)

digitalWrite(low, LOW);

else

digitalWrite(low, HIGH);

if (duration > 1400 && duration <1600)

digitalWrite(med, LOW);

else

digitalWrite(med, HIGH);

if (duration > 1700 && duration <1900)

digitalWrite(high, LOW);

else

digitalWrite(high, HIGH);

}
Sign up now
to remove ads between posts
May 19, 2019, 07:29 AM
Registered User
pierrotm777's Avatar
OpenAVRc Team has developped a feature named X-Any that convert one Channel to 8 or 16 or 32 or 64 on/off switchs.
For that, we use a pcf8574 or pcf8575 on the Tx that convert 8 or 16 switchs and send a command to the rx over a specific channel.
See our doc.
https://github.com/Ingwie/OpenAVRc_D...ser_manual.pdf
May 22, 2019, 08:04 PM
Registered User
Thread OP
Quote:
Originally Posted by pierrotm777
OpenAVRc Team has developped a feature named X-Any that convert one Channel to 8 or 16 or 32 or 64 on/off switchs.
For that, we use a pcf8574 or pcf8575 on the Tx that convert 8 or 16 switchs and send a command to the rx over a specific channel.
See our doc.
https://github.com/Ingwie/OpenAVRc_D...ser_manual.pdf
This is full build? you cant buy the unit pre made?

Using the Nano I have changed the code heaps now and I can also control servos from one channel
May 23, 2019, 02:15 PM
Registered User
pierrotm777's Avatar
Quote:
Originally Posted by Coopznz
This is full build? you cant buy the unit pre made?

Using the Nano I have changed the code heaps now and I can also control servos from one channel
This feature is running only with an OpenAVRc TX. All is open source (not the ms8 firmware but we give a hex file ).
Gerber are ready to use.
May 23, 2019, 08:01 PM
Registered User
Thread OP
Quote:
Originally Posted by pierrotm777
This feature is running only with an OpenAVRc TX. All is open source (not the ms8 firmware but we give a hex file ).
Gerber are ready to use.
No good to me running FrSky
May 24, 2019, 06:10 AM
Registered User
pierrotm777's Avatar
Quote:
Originally Posted by Coopznz
No good to me running FrSky
Why ? OpenAvrc accept also the Frsky-D, Frsky-X and Frsky-V in ppm (externals modules) or spi modes (our internals modules).
And X-Any is running with all these modes.
May 24, 2019, 06:14 PM
Entropy is happening!
Jim.Thompson's Avatar
Quote:
Originally Posted by Coopznz
This is full build? you cant buy the unit pre made?

Using the Nano I have changed the code heaps now and I can also control servos from one channel
Good project Coop, you have got me interested.
I tried without success to set up a logical switch in OpenTx 2.2.2 so that I could both drive the throttle servo and operate an engine cut (kill) switch from the same channel.
Martin describes how to do it at page 33, Section #9 on page 33 here: https://openrcforums.com/forum/viewt...hp?f=45&t=8724

However, I was totally unable to replicate his success, documented here: https://openrcforums.com/forum/viewt...?f=101&t=11921

So I am interested in further details of you arduino project. Are you prepared to share the code?
If so, I would like it.

The current model I am finishing, a tug plane, has now been fitted out with a workaround of the problem of running out of servos. I have reversed one of the flap servos and now drive them both from the one signal (one channel).
This liberated one channel to operate the engine cut switch.

However, I am still interested in the original challenge; how to achieve the two functions on the one Channel, as you have done.
Thanks for the thread.

Jim.
May 24, 2019, 08:53 PM
Registered User
Thread OP
Quote:
Originally Posted by Jim.Thompson
Good project Coop, you have got me interested.
I tried without success to set up a logical switch in OpenTx 2.2.2 so that I could both drive the throttle servo and operate an engine cut (kill) switch from the same channel.
Martin describes how to do it at page 33, Section #9 on page 33 here: https://openrcforums.com/forum/viewt...hp?f=45&t=8724

However, I was totally unable to replicate his success, documented here: https://openrcforums.com/forum/viewt...?f=101&t=11921

So I am interested in further details of you arduino project. Are you prepared to share the code?
If so, I would like it.

The current model I am finishing, a tug plane, has now been fitted out with a workaround of the problem of running out of servos. I have reversed one of the flap servos and now drive them both from the one signal (one channel).
This liberated one channel to operate the engine cut switch.

However, I am still interested in the original challenge; how to achieve the two functions on the one Channel, as you have done.
Thanks for the thread.

Jim.
Hi Jim

I am currently at work for two weeks (Karratha) so will be able to help when I am home

Code has now changed again where I can now control a servo plus switchable outputs too, all on a Nano board
May 24, 2019, 09:44 PM
Entropy is happening!
Jim.Thompson's Avatar
Quote:
Originally Posted by Coopznz
Hi Jim

I am currently at work for two weeks (Karratha) so will be able to help when I am home

Code has now changed again where I can now control a servo plus switchable outputs too, all on a Nano board
Excellent!
No hurry for me, as this is only for any future projects.


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Splitting a channel into several functions Coopznz Fuel Jet Talk 8 Jun 06, 2019 10:02 AM
Discussion Channel overlapping - several VTXs tested by several pilots naitse Multirotor Drone Electronics 3 Aug 09, 2018 10:58 AM
Question Splitting a spare channel to multi momentary functions. Neptune769 Radios 1 Jun 14, 2012 07:58 AM