Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 1
  • *Guests: 48
  • *Total: 49

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

Offline Stinger2k2

  • CockpitBuilder
  • *
  • Posts: 12
  • 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: 12
  • 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

Projector screens changing brightness
by blueskydriver
[Today at 12:03:32 AM]
Solenoid Engines Start Switch Installation
by zeineddine
[Today at 12:01:21 AM]
Back to School SALE event - 50% discount
by luisgordo
[August 16, 2017, 10:09:23 PM]
New here
by 737NGer
[August 16, 2017, 10:23:47 AM]
Telex 750 Headset 4 sale
by jackpilot
[August 15, 2017, 03:16:42 PM]
Boeing 737 Homecockpit parts
by mellox90
[August 14, 2017, 09:02:27 AM]
Hello from New US Based Supplier!
by navcom
[August 14, 2017, 05:44:37 AM]
737-800 Arduino X-Plane Build
by kurt-olsson
[August 13, 2017, 05:36:15 AM]
MH-60 Helicopter (retired Navy simulator) for sale
by navymustang
[August 11, 2017, 08:58:38 PM]
Oasis 737 Project
by 737NGer
[August 11, 2017, 05:11:40 PM]
Project Magenta sounds and PM Systems
by jr2mey
[August 11, 2017, 09:41:58 AM]
In search of this panel...
by XOrionFE
[August 09, 2017, 03:07:23 PM]
Mickey's Flightdeck - A Boeing 737-800 Cockpit on Youtube
by bernard S
[August 09, 2017, 08:21:22 AM]
Upgrade advice and final items clarification
by N606DL
[August 09, 2017, 06:19:22 AM]
XPlane and Avionics softwares.
by Ridgenj
[August 08, 2017, 08:59:32 PM]
Source for Color 5.7" LCD Flat Panels
by gjha97
[August 08, 2017, 12:38:20 PM]
back lite Lamps help needed
by jackpilot
[August 08, 2017, 11:19:56 AM]
CP flight, CDU, throttle
by Orphee
[August 06, 2017, 06:34:10 AM]
Extremely Close Call!
by Joe Lavery
[August 06, 2017, 02:34:29 AM]
P3D v4 Multi Channel
by Ed
[August 05, 2017, 10:38:44 PM]
German B738NG Homecockpit-Projekt
by kurt-olsson
[August 05, 2017, 09:12:08 AM]
mycockpit.org Gone?
by Bob Reed
[August 05, 2017, 08:05:51 AM]
Backlit Knobs Source?
by mickc
[August 04, 2017, 06:33:31 PM]
ActiveSky - across networked PCs anyone
by tennyson
[August 04, 2017, 08:46:21 AM]
Orlando Approach 17L - Working on Atmospheric Conditions & 3rd Party Airports
by Michael_B737_ATP
[August 04, 2017, 08:14:05 AM]
Go home Boeing, you're drunk....
by RayS
[August 03, 2017, 05:53:08 PM]
GoFlight Radio RMK (SOLD)
by jackpilot
[August 03, 2017, 08:38:35 AM]
767 ACE Yoke Aileron potentiometer replacement help !
by B747-400
[August 02, 2017, 04:17:26 PM]
Help me repair ACE yoke
by raam123
[August 02, 2017, 03:54:51 PM]
FDS OH Panels
by gufau
[August 01, 2017, 04:23:37 PM]