Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical switch #2

Closed
ssombra opened this issue Feb 21, 2019 · 2 comments
Closed

Logical switch #2

ssombra opened this issue Feb 21, 2019 · 2 comments

Comments

@ssombra
Copy link

ssombra commented Feb 21, 2019

It looks great!
I use a logical switch to arm my quads, do you know how I can refer to a logical switch (logical switch 2) instead of a physical switch in your code?:
armed = getValue('sa')

thanks

@AndrewFarley
Copy link
Owner

@ssombra I haven't done it off hand but it looks like you're looking for...

model.getLogicalSwitch() from OpenTX Lua Guide

You would probably change the line...

armed = getValue('sa')

to something like...

armed = model.getLogicalSwitch("L1")

I've never used or programmed logical switches, if you figure it out, please feel to share how, and I can add it as a comment to the code and the README so others can use it as well. Cheers!

@ssombra
Copy link
Author

ssombra commented Feb 26, 2019

Hi AndrewFarley. I did figure it out, the names of the logical switches start with "ls" followed by the number so in your script and for the logical switch 2 it would be:
armed = getValue('ls2')
it works great, thanks for this excellent script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants