Flashing light from radio?

Help with any software/desktop related issues. e.g. companion9x, eePe, etc
Post Reply
Rad
Posts: 455
Joined: Wed Apr 20, 2016 3:43 pm
Country: Austria
Contact:

Flashing light from radio?

Post by Rad »

Hi guys. I have seen this:

https://www.youtube.com/watch?v=99IMR3wdFb4

And I wonder if it would be possible to do it with the radio. Yup, I know I need an electronic switch plugged to the receiver, but do you know if it would be possible to switch it on and off like that, just pressing a momentary push button in the radio?

Thanks as always!
https://radindustries.wordpress.com/

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

Re: Flashing light from radio?

Post by Kilrah »

What radio?
Rad
Posts: 455
Joined: Wed Apr 20, 2016 3:43 pm
Country: Austria
Contact:

Re: Flashing light from radio?

Post by Rad »

Kilrah wrote: Thu Apr 26, 2018 9:24 pmWhat radio?
Sorry, a 9x with a 9xtreme and some push buttons installed at the back and a 9xr pro.
https://radindustries.wordpress.com/
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Flashing light from radio?

Post by MikeB »

One way would be to write a script. On ersky9x you may use a logical switch as the source of a mix, and you may also set the logical switch value from a script. Using those features, you may easily program a sequence of channel outputs.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Rad
Posts: 455
Joined: Wed Apr 20, 2016 3:43 pm
Country: Austria
Contact:

Re: Flashing light from radio?

Post by Rad »

MikeB wrote: Fri Apr 27, 2018 8:25 am One way would be to write a script. On ersky9x you may use a logical switch as the source of a mix, and you may also set the logical switch value from a script. Using those features, you may easily program a sequence of channel outputs.

Mike
Is any tutorial out there of how to do it?
https://radindustries.wordpress.com/

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Flashing light from radio?

Post by MikeB »

No tutorial, but there is a document describing the script language, see: http://openrcforums.com/forum/viewtopic.php?f=7&t=10325.

I'll see if I can create a script as a starting point.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Rad
Posts: 455
Joined: Wed Apr 20, 2016 3:43 pm
Country: Austria
Contact:

Re: Flashing light from radio?

Post by Rad »

MikeB wrote: Fri Apr 27, 2018 10:06 am No tutorial, but there is a document describing the script language, see: http://openrcforums.com/forum/viewtopic.php?f=7&t=10325.

I'll see if I can create a script as a starting point.

Mike
Well, I took a look to the script, and for an ignorant like me, it looks impossible, lol.
If you manage to do it, it will be awesome. Just more features to the radio! :D
https://radindustries.wordpress.com/
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Flashing light from radio?

Post by jhsa »

Another ignorant here :)
For sure some good examples could probably get us mortals started :mrgreen:

Thanks again for all Mike

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Flashing light from radio?

Post by MikeB »

OK, so here's a small script. I tested this using a servo on channel 8, with a mix on channel 8 of:
+100% L6
The script declares a byte array to contain a sequence of 1s and 0s that are output at regular intervals. I initialise the array using the strtoarray() function. Note that this function puts a zero byte on the end as a string terminator, so the array needs to be declared at least 1 larger than the number of entries you are using.

Displaying "Light Test" is optional, but it does help show the script is running.

gettime returns elapsed time in units of 10mS, so waiting for 40 to pass is 400mS of time.

I set logical switch L6 to the value an entry in the sequence. I also set the variable "value" just so I can display it later to see it working on the Tx. The index to the sequence is incremented to the next entry, wrapping back to the start when it reaches 14 or more.

Code: Select all

array byte sequence[16]
if init = 0
 init = 1
 strtoarray( sequence[0], "\x00\x00\x00\x01\x01\x01\x00\x00\x01\x01\x00\x01\x00\x01" )
 index = 0
 lasttime = gettime()
 value = 0
end
drawclear()
drawtext(20, 16, "Light Test", 0)
if gettime() - lasttime > 40
 lasttime += 40
 value = sequence[index]
 setswitch( "L6", sequence[index] )
 index += 1
 if index > 13 then index = 0
end
drawnumber( 20, 24, value )
if Event = EVT_EXIT_BREAK then goto done
stop
done:
finish
Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Rad
Posts: 455
Joined: Wed Apr 20, 2016 3:43 pm
Country: Austria
Contact:

Re: Flashing light from radio?

Post by Rad »

And how do I insert this in the radio?
https://radindustries.wordpress.com/
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Flashing light from radio?

Post by MikeB »

It's described at the start of the "Scripts.pdf" I linked to above, treat it as a "standalone" script for now. You run it from the main popup window (MENU LONG from the main screen).

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “Software”