First intrument (Collins RTU) and a question

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

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

First intrument (Collins RTU) and a question

#1 Post by pierclav »

Hi All,

Still a work in progress but everything works so far. I am using Prepar3d V4.1 (which does not support the IDENT function) and Prosim737. I am thinking about implementing IDENT with FSUIPC through a Leo Bodnar interface.

I have hooked up an Arduino Uno with a 4-channel relay board (I first tried with a PI3 but no joy) using this code:

function new_ident()
relay_1 =hw_output_add("ARDUINO_UNO_A_D9",false)
end

function release()
relay_1 =hw_output_add("ARDUINO_UNO_A_D9",true)
end

switch_15 = button_add("clear.png","sel_btn.png",22,260,45,32,new_ident, release)

This works fine. The relay closes when the IDENT button is pressed and opens when it is released. I tried to do it using the hw_output_set command but I could not get it to work. Is the above code an adequate way of doing this? I plan to use this solution for other functions.

Thank you,

Pierre
Attachments
RTU_preview.JPG

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: First intrument (Collins RTU) and a question

#2 Post by Corjan »

Hi,


Try to make sure to only call hw_output_add only once at the start of your script.

Then call hw_output_set when you want to change the output based on flight sim data (or something else).

Code: Select all

my_output = hw_output_add("ARDUINO_UNO_A_D9", false)

function new_ident()
  hw_output_set(my_output ,false)
end

function release()
  hw_output_set(my_output ,true)
end

switch_15 = button_add("clear.png","sel_btn.png",22,260,45,32,new_ident, release)

Hope this makes sense. Let me know if this helps,

Corjan

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

Re: First intrument (Collins RTU) and a question

#3 Post by pierclav »

That worked fined. Thank you. I am now working on eliminating the relay board by having the Air Manager Arduino talking to a MobiFlight Arduino that will send FSUIPC offsets to Prepar3d.

Post Reply