Trying to understand LUA and Xplane

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Trying to understand LUA and Xplane

#11 Post by Kaellis991 »

I need to do some research on "messageport". This is another reference to that term that I have seen over the last few days.

Edit: Googling "What is Messageport" was a mistake...that's a deep rabbit hole.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Trying to understand LUA and Xplane

#12 Post by jph »

:lol:

well, you CAN have

Code: Select all

function switch_callback(position)
  print("The switch got changed to position " .. position)
end


nav_lights = hw_switch_add("nav_lights",3, switch_callback)
position = hw_switch_get_position(nav_lights)
print (position)
and that works, but you are giving it two identical id's ? - but perhaps one is a name, and the other is an ID ? :o :D
Why not just lose one completely ?. If you want to use the 'position' function then you must have both - or at least something in the 'name' area, but, you refer to it by the name' in the 'id' area, or is it the 'id' in the 'name' area.?

Nurse, I need my steady pills :mrgreen:

"What's in a name ? That which we call a rose by any other word would smell as sweet" etc etc
Joe. CISSP, MSc.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Trying to understand LUA and Xplane

#13 Post by jph »

Kaellis991 wrote: Wed Sep 14, 2022 1:20 pm I need to do some research on "messageport". This is another reference to that term that I have seen over the last few days.

Edit: Googling "What is Messageport" was a mistake...that's a deep rabbit hole.
NOooooooooo !
Don't even think about messageport. I was being pedantic. ;)
The AM stuff is amazing. Messageport is definitely NOT for day to day building on small scale. Not only would you need to be conversant in AM, but also in the Arduino IDE and language (C/C++) and also embedded microprocessors etc etc...
No, forget that one. :)

If you google it you will probably end up time travelling with flat earthers :lol:
Joe. CISSP, MSc.

Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Trying to understand LUA and Xplane

#14 Post by Kaellis991 »

jph wrote: Wed Sep 14, 2022 1:32 pm
Kaellis991 wrote: Wed Sep 14, 2022 1:20 pm I need to do some research on "messageport". This is another reference to that term that I have seen over the last few days.

Edit: Googling "What is Messageport" was a mistake...that's a deep rabbit hole.
NOooooooooo !
Don't even think about messageport. I was being pedantic. ;)
The AM stuff is amazing. Messageport is definitely NOT for day to day building on small scale. Not only would you need to be conversant in AM, but also in the Arduino IDE and language (C/C++) and also embedded microprocessors etc etc...
No, forget that one. :)

If you google it you will probably end up time travelling with flat earthers :lol:
I will never google "messageport" again.....

Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Trying to understand LUA and Xplane

#15 Post by Kaellis991 »

I am going to make a new thread for my questions concerning the switch example.
Dont want it to get lost in the middle of this thread about my Autopilot mode control.

Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Trying to understand LUA and Xplane

#16 Post by Kaellis991 »

For my autopilot modes selector shown above, I copied the 5 position ignition switch from the examples as a new hardware function, renamed the function and the switch callback, changed the Xplane commands to datarefs, and now I have a working APmode selector.
That one was easy and it works as advertised. Isn't it great when a plan comes together?
This cockpit build is starting to look and act like a real airplane.
Kirk

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Trying to understand LUA and Xplane

#17 Post by jph »

Nice one Kirk !
It is always difficult when loads of new concepts are thrown at you at the same time. When you eventually start understanding things and getting them working it is great.
It is the JST that did it.
It just looked so professional that you had to make the code work :) :)

Yes, absolutely, it is very rewarding when a plan comes together :D
Joe. CISSP, MSc.

Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Trying to understand LUA and Xplane

#18 Post by Kaellis991 »

Pretty much all paint by numbers. Bob Ross level ....not even close.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Trying to understand LUA and Xplane

#19 Post by jph »

I meant to ask, did the old crimpers work ok ?
Joe. CISSP, MSc.

Kaellis991
Posts: 581
Joined: Mon Sep 07, 2020 8:49 am

Re: Trying to understand LUA and Xplane

#20 Post by Kaellis991 »

jph wrote: Tue Sep 20, 2022 10:29 am I meant to ask, did the old crimpers work ok ?
They worked fine. As well as they do with the Dupont connectors. The tricky part is the short JST connectors dont have much to hold on to on the back side of the crimpers. The dupont connectors are longer and extend further beyond the back side so there is more there to get a finger and thumb on.

Post Reply