Instrument not displaying properly in Air Player

Support for Air Player desktop.

Moderators: russ, Ralph

Message
Author
pierclav
Posts: 35
Joined: Sun Dec 11, 2016 11:57 am
Location: Bangkok

Instrument not displaying properly in Air Player

#1 Post by pierclav »

I have a simple indicator that is triggered by a digital input on an Arduino. All it does is change to yellow using the "Visible" function. It works fine when I run the instrument in Air Manager (3.3) but not in Air Player on the computer I need to run it on. I have other instruments on the same panel and they all fine in Air Player. Any suggestions?

Thank you,

Pierre

SimPassion
Posts: 5339
Joined: Thu Jul 27, 2017 12:22 am

Re: Instrument not displaying properly in Air Player

#2 Post by SimPassion »

Hello Pierre

could you put here a piece of code for to try to figure out what could be the issue ?

Regards
Gilles

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Instrument not displaying properly in Air Player

#3 Post by Sling »

Please post the code so we can take a look. I suppose you could of discovered a bug.

pierclav
Posts: 35
Joined: Sun Dec 11, 2016 11:57 am
Location: Bangkok

Re: Instrument not displaying properly in Air Player

#4 Post by pierclav »

Here is the code with the images. As you will see, there is not much to it. It runs fine all day long on Air Manager but no dice on Air Player.

Thank you,

Pierre
Attachments
master_caution_test_code.zip
(15.17 KiB) Downloaded 217 times

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Instrument not displaying properly in Air Player

#5 Post by Sling »

Pierre,

Can you try this. I'm just getting ready to move so most of my sim stuff is packed away so i'm unable to try but I noticed the extra hw_input_read in your code that is not required. I doubt this is the issue but worth checking/noting. You can also reduce the callback code to a single statement as shown.

Just a small thing to make it quicker for others to help in future please use the export feature in AM to make the instrument zip as it's just a simple case of using the AM import to get the instrument up and running.

Can someone else please help Pierre by checking this with Air Player.

MC Test.zip
(16.69 KiB) Downloaded 230 times

Tony

Code: Select all

master_caution_off = img_add("master_off.png", 125, 9, 85, 85)
master_caution_on = img_add("master_on.png", 125, 9, 85, 85)
visible(master_caution_on, false)

function input_change(state)

	visible(master_caution_on, state)

end

hw_input_id = hw_input_add("ARDUINO_UNO_A_D3", input_change)

SimPassion
Posts: 5339
Joined: Thu Jul 27, 2017 12:22 am

Re: Instrument not displaying properly in Air Player

#6 Post by SimPassion »

Just in case, in order to work with Air Player instrument,
the Arduino board should be mandatory connected to the same PC where Air Player is running
checked OK at the moment
pierclav_mastercaution.zip
(24.09 KiB) Downloaded 232 times
Regards
Gilles

SimPassion
Posts: 5339
Joined: Thu Jul 27, 2017 12:22 am

Re: Instrument not displaying properly in Air Player

#7 Post by SimPassion »

Hello Tony

it works also with you code on my own

Regards
Gilles

pierclav
Posts: 35
Joined: Sun Dec 11, 2016 11:57 am
Location: Bangkok

Re: Instrument not displaying properly in Air Player

#8 Post by pierclav »

Gilles,

Thank you for the info. I just moved my Arduino to my Air Player machine and everything is good now.

Best regards,

Pierre

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Instrument not displaying properly in Air Player

#9 Post by Sling »

Quite frequently it's a simple solution. :-)

pierclav
Posts: 35
Joined: Sun Dec 11, 2016 11:57 am
Location: Bangkok

Re: Instrument not displaying properly in Air Player

#10 Post by pierclav »

I am sure this was only the first of many headaches. I am phasing out my Opencockpits set up and going pretty much all Arduino. I have 2 Mega boards hooked-up back-to back (One Air Manager and one Mobiflight). First tests look promising. We'll see how it goes for the rest.

Post Reply