Search found 57 matches

by lshems
Sat Jun 06, 2020 7:17 am
Forum: openTx
Topic: lcd.drawText() and color
Replies: 3
Views: 278

Re: RE: Re: lcd.drawText() and color

wilopaan wrote:Ok, thank you.

In some scripts I saw lcd.getText() with a color attribute added, e.g. SMLSIZE + GREY. I think the battcheck widget had that. This isn't documented and I was wondering if one could use that.
Mmm. Didn't notice that. I need to check that out.
by lshems
Fri Jun 05, 2020 6:44 pm
Forum: openTx
Topic: Global variables: share data between mix-script and widget
Replies: 11
Views: 560

Re: Global variables: share data between mix-script and widget

You have to activate the telemetry simuator in the sim as well. little tickbox in the left to corner of the telemetry sensor simulator screen :). testscript (run as telemetry, discover sensors): return { background = function() setTelemetryValue(0Xabcd,0,101, getValue('thr'), 0, 0, "wm01"); end, run...
by lshems
Fri Jun 05, 2020 2:51 pm
Forum: openTx
Topic: lcd.drawText() and color
Replies: 3
Views: 278

Re: lcd.drawText() and color

Opentx widgets use a colour palette for different elements. So you can set a colour for text, background, ... It will be the colour used for ALL txt elements. If you want to change it for only YOUR widget, read the current colour, store it, set the colour to your choice, write the text and revert th...
by lshems
Wed Jun 03, 2020 10:45 pm
Forum: openTx
Topic: Global variables: share data between mix-script and widget
Replies: 11
Views: 560

Re: RE: Re: Global variables: share data between mix-script and widget

Well, I checked your example. Writing / reading gvars works fine, but clutters the gvars oviously. setTelemetryValue() / getValue() dows not work for me, since getValue() allways returns 0 for the name used in setTelemetryValue(): the sensor is created, I can see it in the telemetry menu, but getVa...
by lshems
Wed Jun 03, 2020 5:00 pm
Forum: openTx
Topic: Global variables: share data between mix-script and widget
Replies: 11
Views: 560

Re: Global variables: share data between mix-script and widget

The global variables you referred to are the model gvars.
by lshems
Wed Jun 03, 2020 5:00 pm
Forum: openTx
Topic: Global variables: share data between mix-script and widget
Replies: 11
Views: 560

Re: Global variables: share data between mix-script and widget

Ok, check this script:

https://www.justfly.solutions/index.php ... ogchannels

It writes a channel value to a virtual telemetry channel.

You can just use getValue (sensorname) to read it in the other script.

Don't forget to discover while the sending is active.
by lshems
Wed Jun 03, 2020 4:49 pm
Forum: openTx
Topic: lcd.drawScreenTitle() and INVERS
Replies: 1
Views: 1299

Re: RE: lcd.drawScreenTitle() and INVERS

wilopaan wrote:Hi all,

is there a possiblility to display the page/pages field INVERS?

Thanks!
Make your own function for it. I never understood the reason to have an API function for it.
by lshems
Wed Jun 03, 2020 3:09 pm
Forum: openTx
Topic: Global variables: share data between mix-script and widget
Replies: 11
Views: 560

Re: RE: Re: Global variables: share data between mix-script and widget

Well, that is really bad! writing / reading a file seems to be a quite of overhead. Are you you sure, that there is not other pssibility? (in the poist above I meant global-lua-script-variables, not global vars in the sense of OpenTx). The widget i wrote (ab)uses some trims to emulate buttons and p...
by lshems
Wed Jun 03, 2020 1:33 pm
Forum: openTx
Topic: Mixer scripts in companion? Where?
Replies: 2
Views: 191

Re: Mixer scripts in companion? Where?

Use the standalone simulator on an otx file. Changes are persistent.
by lshems
Wed Jun 03, 2020 1:14 pm
Forum: openTx
Topic: Global variables: share data between mix-script and widget
Replies: 11
Views: 560

Re: RE: Global variables: share data between mix-script and widget

I used to use global variables to exchange data between telemetry scripts and mixer script. Now I want to do the same with a widget and a mix-script. Looks like the global var of the widget is not seem from the mix-script. How can one achieve this? Thanks! You can't. Use a table to store the stuff ...
by lshems
Sun May 24, 2020 10:04 am
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

Does that mean, that the e.g. mixer scripts are generally disabled when the tools script runs. Or are they called round robin? Disabled. 'tool' scripts run exclusive. Ok, thats no good news. Then I have to use some switches or pots ... until the widgets support events from the ui-buttons Make sure ...
by lshems
Sun May 24, 2020 9:24 am
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

wilopaan wrote:Does that mean, that the e.g. mixer scripts are generally disabled when the tools script runs. Or are they called round robin?
Disabled.

'tool' scripts run exclusive.
by lshems
Sun May 24, 2020 8:00 am
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

Ok, the frequency the tools-scripts are called seems to be much higher than telemetry scripts. So the debug sometimes yields a kind of overflow. The good thing is, that porting telemetrie scripts to tools scripts is easy (well, no lcd.drawScreenTitle() ?). One drawback is, that running a tools scri...
by lshems
Sun May 24, 2020 7:59 am
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

There are 'switches' which are 2 or 3 position toggle and there are navigation buttons/rotaries that generate EVENTS. Events are auto updated by the Operating System, Switches must be polled to get current status. You can generate events yourself, especially if you have to call the run script from ...
by lshems
Sun May 24, 2020 1:45 am
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

Ok, thank you. I used the telemetry scripts and their event-handling to create some interactive functionality. How can I do that now? Are widget script capable of processing button events? No, but switch events. I use two three state switches to simulate plus/minus and enter/exit. Works as a charm,...
by lshems
Sun May 24, 2020 1:45 am
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

wilopaan wrote:There is no output from the scripts in the debugging console and after some seconds it crashes with "too much open files"
Then you do probably something wrong. Don't write to the debug screen every cycle a lot of data. It will crash indeed.
by lshems
Sat May 23, 2020 9:31 pm
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

There are no telemetry scripts on any of the color radios in OpenTX, widgets are used instead. Ok, thank you. I used the telemetry scripts and their event-handling to create some interactive functionality. How can I do that now? Are widget script capable of processing button events? No, but switch ...
by lshems
Sat May 23, 2020 9:29 pm
Forum: openTx
Topic: RadioMaster TX16s: where do I activate LUA and telemetry scripts
Replies: 22
Views: 1152

Re: RE: Re: RadioMaster TX16s: where do I activate LUA and telemetry scripts

wilopaan wrote:Mmh, next problem: print() is not working in companion? How to debug things then?
Why not? Should.
by lshems
Fri Apr 24, 2020 1:12 pm
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: RE: Re: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

wilopaan wrote:Next question: using the companion, how to simulate 2 or more RPM sensors.

When I start the simulation, there is only one RPM Sensor, but I need of course a second. How can I add a second one?

Thanks.
Don't get your point?

by lshems
Tue Apr 21, 2020 8:16 pm
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

Ah yes! So the value of an input/mixer for t(n) is always based on another value for t(n-1)? Well, that is tricky to say. But to not even bother about that, I just put every mixer Inthe order if calculation. So first the current error. That's simple. But then, I need the current error minus the las...
by lshems
Tue Apr 21, 2020 6:58 am
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

wilopaan wrote:
Tue Apr 21, 2020 6:23 am
Well, just had a quick look at your solution.

One question, because I could not get it on the first glance: how do you compute the integration, that is the sum of the error over time?
the int channel plus the error equals the int channel
by lshems
Mon Apr 20, 2020 11:22 pm
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

Oh, very cool! Would be glad to hear more ... this week I'am busy at bussiness. Thanks! How about this :) screenshot_x9d+_20-04-21_01-09-23.png used a throttle as output parameter, with weight, offset (simulated load) and delay on this throttle as resulting RPM to match the set RPM. Don't get any e...
by lshems
Mon Apr 20, 2020 3:37 pm
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: RE: Re: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

Kilrah wrote:Between the slow and multiply in mixer it should be possible to do something...
Been busy with it.

Seems possible. Got already a nice dampened oscillator.

Figuring out if I can check if it's working correctly.

Fun project.
by lshems
Sun Apr 19, 2020 5:25 pm
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: RE: Re: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

Ok, thanks! But you don't have to do that: a lua telemetry script for the PID-controller ist not the problem for me ;-) I just want to ask if the is something built-in to openty that I could use. Well, no. Dont think so. Would be fun to see if it could be done by only mixers. Did a swash ring with ...
by lshems
Sun Apr 19, 2020 4:53 pm
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: RE: Re: RE: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

wilopaan wrote:
lshems wrote:
Sun Apr 19, 2020 4:31 pm
Radio type?
Jumper T12 with OpenTx
Ok, I'll write you a pid controller. Just send me the main inputs and output calculations, or some other documents on what you want.pid governors isyears ago for me.

It will be a lua script.
by lshems
Sun Apr 19, 2020 4:31 pm
Forum: openTx
Topic: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)
Replies: 18
Views: 1218

Re: RE: How to make a PID-Controller: control the throttle (ESC) for a given RPM (governor)

Hi all, I habe telemetry to get the RPM of the motor of a ship-model. My idea ist to implement a pid-controller for the RPM of the motor. The Input gives the setpoint and the telemetrie measured RPM the process value. With a mixer it is easy to implement the proportional part, but how to differenti...
by lshems
Sat Mar 07, 2020 8:47 am
Forum: openTx
Topic: LUA script to display text based on telemetry sensor value
Replies: 1
Views: 1507

Re: RE: LUA script to display text based on telemetry sensor value

Hi all, is it possible to display a (arbitrary) text based on some sensor value in the telemetry screen? E.g. if sensor value < 100, display "low" if sensor value >= 100 && value < 200 display "mid" if sensor value >= 200 display "high" Any hints to do this? Check my blog on rcgroups, and check the...
by lshems
Tue Mar 03, 2020 5:02 pm
Forum: openTx
Topic: Something like Multichannel
Replies: 12
Views: 2853

Re: RE: Re: Something like Multichannel

I assume, the switches of the TX are digital monitored, so there is no noise by an analog sampling or so. Then it should be possible to mix the switches togethher to produce a mixer-output that is easy to decode on the receiver side, when the channel output is digital via IBUS/SBUS. For three 3-way...

Go to advanced search