Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 1
  • *Guests: 53
  • *Total: 54

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

Offline Stinger2k2

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

 

Recent Posts

Attention All Members and Guests
by Erj145sim
[Today at 03:02:57 PM]
Oasis 737 Project
by Garys
[Today at 02:16:35 PM]
Former RC airplane pilots...need your help!
by Trevor Hale
[Today at 07:22:18 AM]
de Havilland Beaver Sim Pics
by FSAddon_boss
[Today at 04:01:52 AM]
My Hangar
by fsaviator
[April 28, 2017, 10:03:37 AM]
Hello From Malta
by Trevor Hale
[April 28, 2017, 09:48:02 AM]
Help: Interfacing a Prop Sync indicator...
by Trevor Hale
[April 28, 2017, 09:34:31 AM]
New TQ
by Caflyt
[April 28, 2017, 05:05:14 AM]
New AFT OVH
by MLeavy737
[April 27, 2017, 10:59:02 AM]
eBay is making me go broke again...
by RayS
[April 26, 2017, 05:33:03 PM]
Rotary with a button
by Erj145sim
[April 26, 2017, 03:48:02 PM]
Poor Airplane....
by Joe Lavery
[April 26, 2017, 02:19:19 PM]
New supplier for your sim
by jackpilot
[April 26, 2017, 01:57:06 PM]
10.4 LCD Source?
by Erj145sim
[April 26, 2017, 11:49:42 AM]
Flightdeck Solutions still the best IMHO
by Trevor Hale
[April 26, 2017, 04:40:47 AM]
Autoland at Bergen airport (ENBR)
by jackpilot
[April 25, 2017, 11:26:51 PM]
Phidgets Advanced Servo 8-Motor Card
by pierclav
[April 25, 2017, 10:40:23 PM]
737NG Single Seat Trainer "Starter Kit" :-)
by emstar
[April 25, 2017, 03:12:41 PM]
Engravity glarewings set for sale
by scojj
[April 23, 2017, 06:00:01 AM]
CPFlight MIP board
by scojj
[April 23, 2017, 05:57:42 AM]
CPFlight MIP737ICS and project magenta : gauges issue.
by scojj
[April 23, 2017, 05:54:18 AM]
Life of a Veteran Airplane
by iwik
[April 22, 2017, 04:09:57 PM]
Boeing 737NG parts: OVH, MIP and Yoke
by rtopinka
[April 21, 2017, 06:41:23 PM]
SEP/MEP 3DOF motion simulator for sale
by rtopinka
[April 21, 2017, 05:09:36 PM]
Cockpit Parts
by goirishgo1083
[April 20, 2017, 02:52:50 PM]
X-Plane 11 multi-monitor & Fly Elise-ng - tuto
by pierrevw
[April 18, 2017, 05:48:32 PM]
KIng Air yokes
by RayS
[April 18, 2017, 05:40:03 PM]
I Need A Particular Photo.......
by FredK
[April 17, 2017, 03:05:10 PM]
Looking for FDS G2 EFIS Unit
by Trevor Hale
[April 17, 2017, 02:56:23 PM]
737 Overhead frame.
by kurt-olsson
[April 17, 2017, 01:17:07 PM]