When making telemetry scripts, is it possible to get the position of a Logical Switch (false or true)?
The same question for the position of the physical switches?
These ones I check now with its value (<-100 = up, >100 = down, else is middle position)
Lua Script position Logical Switch
Re: Lua Script position Logical Switch
Yes
See
https://opentx.gitbooks.io/opentx-2-2-l ... e/content/
I'm on the road using my mobile else Id give the exact page to look at.
My battery remaining script accesses logical switches.
See
https://opentx.gitbooks.io/opentx-2-2-l ... e/content/
I'm on the road using my mobile else Id give the exact page to look at.
My battery remaining script accesses logical switches.
RCdiy.ca
Stay Safe & Have Fun
OpenTX Manual http://rcdiy.ca
Paying it forward by sharing my Lua scripts, documentation and videos.
Stay Safe & Have Fun
OpenTX Manual http://rcdiy.ca
Paying it forward by sharing my Lua scripts, documentation and videos.
-
- Posts: 750
- Joined: Tue Dec 27, 2011 11:22 pm
- Country: United States
- Location: Carson City, Nv
Re: Lua Script position Logical Switch
https://opentx.gitbooks.io/opentx-2-2-l ... Value.html
SwPos = getValue("sa")
returns numerical value, you must make it true or false if that is needed.
SwPos = getValue("sa")
returns numerical value, you must make it true or false if that is needed.
Dean
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1
Re: Lua Script position Logical Switch
Thank you both! With the physical switches I had already solved it, like I wrote in my openings post, but with the logical switches I did not succeed.....
It turned out I used the wrong ID (l1 instead of ls1)!
Now it works!
@rdeanchurch: on the website you mentioned, I also found a code to make an extra function to convert the value into a letter: "U", "M" and "D". That also works nice.
Again, thanks to both of you!
Verstuurd vanaf mijn A0001 met Tapatalk
It turned out I used the wrong ID (l1 instead of ls1)!
Now it works!
@rdeanchurch: on the website you mentioned, I also found a code to make an extra function to convert the value into a letter: "U", "M" and "D". That also works nice.
Again, thanks to both of you!
Verstuurd vanaf mijn A0001 met Tapatalk