Welcome to Cockpitbuilders.com. Please login or sign up.

March 29, 2024, 04:30:20 AM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
163 Guests, 1 User
Members
Stats
  • Total Posts: 59,639
  • Total Topics: 7,853
  • Online today: 179
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 1
Guests: 163
Total: 164

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

Lua code help needed=Answered !

Started by Stinger2k2, February 11, 2017, 04:09:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stinger2k2

Hi all,

Can a LUA expert have a look at this for me please to see what I am doing wrong...

The aircraft I am working with is the Carenado Phenom 300.

This is what I see in the LINDA tracer when right click the ALT SEL knob in the aircraft VC to switch between altitude increments of 100 or 1000.
******
Watching new LVar: H850XPAltWheelPUSHTOGGLE = 0
LVar: H850XPAltWheelPUSHTOGGLE = 1
LVar: H850XPAltWheelPUSHTOGGLE = 0
LVar: H850XPAltWheelPUSHTOGGLE = 1
********
This is the LUA function I wrote .....
********
function alt_incr_toggle_100 ()
     ipc.writeLvar("HP850XPAltwheelPUSHTOGGLE", 1)
end
function alt_incr_toggle_1000 ()
     ipc.writeLvar("HP850XPAltwheelPUSHTOGGLE", 0)
end
********
I then assigned this onto a button in LINDA using the fields ON PRESS and ON RELEASE.

However when I watch the same Lvar in the tracer while pushing and releasing the assigned button the tracer shows no change? LINDA sees the button as working (i.e when I push the button LINDA moves to assign button position 30)

This is similar code that I have written for other switch functions and they work ok.

Any ideas?


Regards
Stinger

Stinger2k2


Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate