Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 1
  • *Guests: 25
  • *Total: 26

Author Topic: Lua code help needed=Answered !  (Read 155 times)

Offline Stinger2k2

  • CockpitBuilder
  • *
  • Posts: 6
  • Aviation Enthusiast
  • First Name: Keith
  • Home Location: Bexhill
Lua code help needed=Answered !
« on: February 11, 2017, 08:09:20 AM »
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
« Last Edit: February 11, 2017, 10:34:59 AM by Stinger2k2 »

Offline Stinger2k2

  • CockpitBuilder
  • *
  • Posts: 6
  • Aviation Enthusiast
  • First Name: Keith
  • Home Location: Bexhill
Re: Lua code help needed--Answered
« Reply #1 on: February 11, 2017, 10:34:33 AM »
Ok, sorted myself out now thanks.

 

Recent Posts

Incident Parts
by mickc
[Today at 06:49:16 PM]
Does anyone sell access to their sim as a business?
by fsaviator
[Today at 10:33:47 AM]
Simionic G1000 app....which ipad?
by Stinger2k2
[Today at 08:56:20 AM]
Go Flight Landing gear panel
by Pilotito84
[February 20, 2017, 10:54:34 PM]
Saitek Radio panel
by Pilotito84
[February 20, 2017, 10:53:24 PM]
B747/767 XPDR, NAV, VHF modules
by Pilotito84
[February 20, 2017, 10:51:51 PM]
Trevor you were right....
by Trevor Hale
[February 20, 2017, 12:54:09 PM]
FSUIPC For Dummies
by Trevor Hale
[February 20, 2017, 12:49:52 PM]
More (or similar) 836x overheat issues
by Mach7
[February 20, 2017, 12:16:16 PM]
Software add on (RAAS)
by Bob Reed
[February 19, 2017, 08:55:32 PM]
NG Korry's Bulbs or LED's?
by mickc
[February 19, 2017, 09:18:40 AM]
This weekend
by jackpilot
[February 19, 2017, 08:49:38 AM]
Shake and rattle Take off
by jackpilot
[February 18, 2017, 02:05:27 PM]
Frustration to the limit!
by Flying_Fox
[February 18, 2017, 12:30:48 PM]
For sale Prosim737 Suite SOLD
by nigel27
[February 18, 2017, 12:15:23 AM]
Hello from NL, C90 sim project
by rvdm
[February 17, 2017, 03:32:22 AM]
F-18 simpit builder
by Trevor Hale
[February 17, 2017, 01:45:33 AM]
Wanted: F-18 parts
by Fcoq
[February 16, 2017, 08:30:50 AM]
My Boeing 737-800 cockpit
by Winstonc
[February 15, 2017, 08:17:02 PM]
SST30I
by ColinB
[February 15, 2017, 03:24:03 PM]
F/A-18C build
by Chain
[February 15, 2017, 08:50:22 AM]
Crash on 3.46 startup
by dalpi
[February 15, 2017, 06:55:27 AM]
http://flightsimcon.com/ ?
by bernard S
[February 14, 2017, 04:19:12 PM]
F-18 cockpit(s) for sale
by navymustang
[February 14, 2017, 03:08:56 PM]
Projector colour Matching & alignment.
by brianwilliamson
[February 14, 2017, 02:29:38 PM]
Hi from Austria
by Bob Reed
[February 13, 2017, 05:03:40 PM]
opencockpits OVH dual brightness annunciators
by airupthere
[February 13, 2017, 04:46:30 PM]
How to increase an Lvar value by 6 or -6 ? - ANSWERED
by Trevor Hale
[February 13, 2017, 07:16:14 AM]
Oxygen Mask Stowage Box - brown
by bernard S
[February 12, 2017, 04:00:54 PM]
"WANTED" IPECO pilot seat bottom cushion
by bernard S
[February 12, 2017, 11:13:57 AM]