Many questions about 7 segment display modules

Are you building a cockpit, planning to build one or just dreaming, this is your cockpit builder meeting point

Moderators: russ, Ralph

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

Re: Many questions about 7 segment display modules

#81 Post by Kaellis991 »

Just as a point of reference, I connected the 5 digit display to Xplane with mobiflight in about 15 minutes last night.
No programming required. Find the correct Dataref, check boxes for 5 digits and reverse the digits.

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

Re: Many questions about 7 segment display modules

#82 Post by Keith Baxter »

Hi,

Yes the way AM handles shift registers is the difference between Mclaren and Red Bull. :mrgreen:

We can only ask for ease of use.

This also frustrates me. I have spent a big chunk of change in time trying to help.
I am sure peeps can read between the lines here.

Not your fault Kirk and happy to assist on other protects should you find the need.

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: Many questions about 7 segment display modules

#83 Post by Kaellis991 »

Keith,

I still want to go down the AM path with your code.
As soon as the sun comes up here I will download that .siff file and give it a try.

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

Re: Many questions about 7 segment display modules

#84 Post by Keith Baxter »

Kaellis991 wrote: Sat Mar 25, 2023 10:30 am Keith,

I still want to go down the AM path with your code.
As soon as the sun comes up here I will download that .siff file and give it a try.
Kirk,

I understand.
I just want the SI guys to see the frustration peeps go through, and for them to try and make things a little more flexible without us having to resort to hacking and message port.
I love Air Manager, It is a awesome product, but is frustrates me sometimes. 8-)

Rant over.

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: Many questions about 7 segment display modules

#85 Post by Kaellis991 »

jph wrote: Sat Mar 25, 2023 8:21 am
Kaellis991 wrote: Fri Mar 24, 2023 5:53 pm I changed <% 9.4f> to <% 9.2f> and now the decimal is in the correct location

FDF0C742-884D-457B-A97D-C6B926632770.jpeg
Nice job Kirk,
;)
Thank you sir...

My keyboard helped me out a lot giving me the opportunity to change a 4 to a 2.... ;)

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

Re: Many questions about 7 segment display modules

#86 Post by Kaellis991 »

Keith Baxter wrote: Sat Mar 25, 2023 4:30 am Hi,

Here is the NAV radio. Please test and let me know if it is OK.

Kirk - NAV Radio.siff

Keith
Keith,

Here is what I imported from the .siff file.
There are a couple of things that are not exactly correct.
My NAV1 (and COM1) are part of my realsimgear GNS530 so I do not want to use the datarefs for those freqs.
The radios will have no standby function and will be accessing the datarefs for NAV2 and COM2.

I assume then I need to go through this code and change the variable names and add in my datarefs as required and delete the stuff I do not need?

Also it looks like the rotary encoder code is here also. I have one encoder connected along with the one display, so I will see if I can get that connected and working also.

Code: Select all

--Zibo 737 NAV1 Radio By Keith Baxter for Kirk 5 digit display reverse

-- Add two characters displays, One for active and one for standby.
NAV1_display         = hw_chr_display_add("NAV1 ACTV frequency", "MAX7219",2)

--Function to add characters to the displays
xpl_dataref_subscribe("sim/cockpit2/radios/actuators/nav1_frequency_hz", "INT",
                      "sim/cockpit2/radios/actuators/nav1_standby_frequency_hz", "INT",
                      "laminar/B738/electric/panel_brightness","FLOAT[4]",
                      "laminar/B738/comm/nav1_status","FLOAT",function(nav1_actv, nav1_stby,bright,disp_stat)
    local display_act    = string.reverse(display_act)
    display_act             = string.format("% 9.2f",(nav1_actv/10))
    local display_stby  = string.reverse(display_stby )
    display_stby           = string.format("% 9.2f",(nav1_stby/10))
    if display_act   == nil or disp_stat == 0 then display_act   ="        " end
    if display_stby  == nil or disp_stat == 0 then display_stby  ="        " end
    --Set the characters and opacity of the displays
    hw_chr_display_set_text(NAV1_display, 0, 0,display_act)
    hw_chr_display_set_text(NAV1_display, 1, 0,display_stby)
    hw_chr_display_set_brightness(NAV1_display,0,tonumber(bright[4]))
    hw_chr_display_set_brightness(NAV1_display,1,tonumber(bright[4]))
end)

--Add the push buttons
hw_button_add("NAV1 Transfer button",function()
    xpl_command("laminar/B738/push_button/switch_freq_nav1_press")
end)
hw_button_add("NAV1 Test button",function()
--    xpl_command("")
end)

--Add dials to set standby frequencies
hw_dial_add("NAV1 Com Course","TYPE_2_DETENT_PER_PULSE", function(dir)
    if dir == -1then xpl_command("sim/radios/stby_nav1_coarse_down") end
    if dir ==  1then xpl_command("sim/radios/stby_nav1_coarse_up") end
end)
hw_dial_add("NAV1 Com fine","TYPE_2_DETENT_PER_PULSE", function(dir)
    if dir == -1then xpl_command("sim/radios/stby_nav1_fine_down") end
    if dir ==  1then xpl_command("sim/radios/stby_nav1_fine_up") end
end)

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

Re: Many questions about 7 segment display modules

#87 Post by Keith Baxter »

Kirk,

Ok I was confused. I wondered why the code you posted referred to NAV2 and COM2.

is that the radio you want to work?

Will do that for you 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 

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

Re: Many questions about 7 segment display modules

#88 Post by Kaellis991 »

Keith Baxter wrote: Sat Mar 25, 2023 1:01 pm Kirk,

Ok I was confused. I wondered why the code you posted referred to NAV2 and COM2.

is that the radio you want to work?

Will do that for you tomorrow.

Keith
Yes sir. My NAV1 and COM1 are already accounted for. I need a simple NAV2 and COM2 without the standby function....you know...Old School stuff.
Last edited by Kaellis991 on Sun Mar 26, 2023 9:17 am, edited 1 time in total.

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

Re: Many questions about 7 segment display modules

#89 Post by jph »

image.png
image.png (51.24 KiB) Viewed 20244 times
Joe. CISSP, MSc.

Post Reply