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

#51 Post by Kaellis991 »

Here is the result...
235D4D5B-8C8D-44AC-9148-3BE49314769A.jpeg

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

Re: Many questions about 7 segment display modules

#52 Post by Keith Baxter »

Kaellis991 wrote: Fri Mar 24, 2023 4:37 pm Here is the result...

235D4D5B-8C8D-44AC-9148-3BE49314769A.jpeg
Ok on line 8 change the format to "% 9.2f"

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

#53 Post by Kaellis991 »

That moved the decimal over to the left
as well as the digits.
8B6F1476-82E2-4991-A25C-336E18DE9C6B.jpeg

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

Re: Many questions about 7 segment display modules

#54 Post by Keith Baxter »

Kaellis991 wrote: Fri Mar 24, 2023 4:45 pm That moved the decimal over to the left

8B6F1476-82E2-4991-A25C-336E18DE9C6B.jpeg
I know what the issue is. The AM library is sending a decimal to the wrong segment.

Lets try this.

Code: Select all

--Create a variable to simulate a value from the sim
sim_value = "123.05"
--format the string
sim_value =  string.format("% 9.2f",sim_value)
--Reverse the string
sim_value = string.reverse(sim_value)
-- Create a new Max7219 based character display
display_chr_id = hw_chr_display_add("NAV1 frequency", "MAX7219", 1)

-- Set text to the manipulated sim string value
hw_chr_display_set_text(display_chr_id, 0, 0, sim_value)
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

#55 Post by Kaellis991 »

FA58AEEA-438B-4B5F-92F8-430A5493B27C.jpeg

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

Re: Many questions about 7 segment display modules

#56 Post by Keith Baxter »

Kaellis991 wrote: Fri Mar 24, 2023 4:55 pm FA58AEEA-438B-4B5F-92F8-430A5493B27C.jpeg
I know whatever we do it is not going to work.
As soon as we revers the string the .0 becomes 0. and the decimal is sent to the other segment.

We will have to wait for @Corjan or @Ralph to help us here.
It might be possible to do it using message port but that is out of my scope.
Lets hope the SI guys feel sorry for us and can help.

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

#57 Post by Kaellis991 »

Keith,

Do you know if mobiflight can handle it?
From what I have been reading I could have mobiflight and AM connected to Xplane.

I was wondering if I could set up the radios on mobiflight while everything else is on AM.

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

Re: Many questions about 7 segment display modules

#58 Post by Keith Baxter »

Hi,

I think it can.
However Air Manager should have the ability to do it.
Lets first wait for Corjan and Ralph to respond before going that route. I am sure they will assist.

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

#59 Post by Kaellis991 »

Sure thing, but I have a Mega2560 and another one of those displays.
I think I will play around with it just for grins..

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

Re: Many questions about 7 segment display modules

#60 Post by Keith Baxter »

Kirk,

I just thought of something try this.

Code: Select all

sim_value = "123.05"

--Reverse the string
sim_value = string.reverse(sim_value)

--format the string
sim_value =  string.format("% 9.4f",sim_value/10)

-- Create a new Max7219 based character display
display_chr_id = hw_chr_display_add("NAV1 frequency", "MAX7219", 1)

-- Set text to the manipulated sim string value
hw_chr_display_set_text(display_chr_id, 0, 0, sim_value)
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