Having a difficult time with LUA concepts

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

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

Having a difficult time with LUA concepts

#1 Post by Kaellis991 »

I have been studying Tonys Instrument video series, specifically E26-Hardware Part 1 and E27-Hardware Part 2 attempting to understand how all of these pieces come together to do what I need.
My goal is to use the switch in the photo to switch an electromagnet (not shown) on and off with the relay module. I have the diode to control the flyback.
The 12v relay circuit is straightforward and I have that taken care of.

What I am having trouble with is the LUA coding needed to send the HIGH 5v signal to the IN pin on the relay.

I can get the (3) pin switch connected by following the E26 video and it will print out the positions in the console as it should. (see below)
Then from E27 "input" and "output sections I can duplicate those exercises.

But I am at a loss on understanding the concepts of how to combine all of this to get that relay to work.
I need the switch (the NO side) to close and activate the selected arduino pin attached to the IN connection on the relay to turn on/off the 12v magnet.

Also, the NC side (when closed again) will need to send a signal to the autopilot servos in Xplane. That LUA coding is still a mystery to me.

If anyone can give me some advice on how to bring all of these separate pieces of code together I would be really grateful.
I just cant seem to get a handle on it......
relay.JPG
E26 switch.jpg
E27 Input.jpg
E27 Output.jpg

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Having a difficult time with LUA concepts

#2 Post by Keith Baxter »

Hi,

What you want is relatively easy. It is probably easier to chat and share screens on the Discord.

I will be available tomorrow from about UCT12h00 should you wish to catch up.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

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

Re: Having a difficult time with LUA concepts

#3 Post by Kaellis991 »

Keith,

I have not used discord. Not really sure exactly what it is.
After a search I found Discord.com and select <download for windows>?
Run the setup and then create an account?

EDIT: Account created.....I will need some direction with this discord thingy.....
Last edited by Kaellis991 on Fri Dec 31, 2021 6:41 pm, edited 1 time in total.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Having a difficult time with LUA concepts

#4 Post by Keith Baxter »

Kaellis991 wrote: Fri Dec 31, 2021 6:30 pm Keith,

I have not used discord. Not really sure exactly what it is.
After a search I found Discord.com and select <download for windows>?
Run the setup and then create an account?
Hi,

The link to join is here.
viewtopic.php?t=4422

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

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

Re: Having a difficult time with LUA concepts

#5 Post by Kaellis991 »

I have a discord app opened on my computer.....now what?

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Having a difficult time with LUA concepts

#6 Post by Keith Baxter »

Hi,

I am with family ATM and on my phone so I can’t share screens.

What is your discord ID?

I will have a quick text chat. Meet you there.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Having a difficult time with LUA concepts

#7 Post by Keith Baxter »

Kaellis991 wrote: Fri Dec 31, 2021 6:53 pm I have a discord app opened on my computer.....now what?
Did you follow the link and join Air Man?

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

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

Re: Having a difficult time with LUA concepts

#8 Post by Kaellis991 »

This is where I am....Says Air Man at the top and I think my ID is #4216

image.png

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

Re: Having a difficult time with LUA concepts

#9 Post by Kaellis991 »

Keith,
No hurry on this. I think I have it set up properly though.
Kirk

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Having a difficult time with LUA concepts

#10 Post by Keith Baxter »

Kaellis991 wrote: Fri Dec 31, 2021 7:30 pm Keith,
No hurry on this. I think I have it set up properly though.
Kirk
Hi,
Yes you are at the right place. Click on the channels and have a read. Ask questions in the general chat. Others chime in and share ideas and thoughts.

As I said, tomorrow I can help.

I am getting a some funny looks from my family so I am going AWAL till tomorrow
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply