7 segment display reverse digits

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Post Reply
Message
Author
old pilot guy
Posts: 30
Joined: Wed Dec 25, 2019 8:55 pm

7 segment display reverse digits

#1 Post by old pilot guy »

Have been using AM for many years. Recently purchase some high quality 4,5,6 digit 7 segment displays which have the Max7219 chips and board already attached.
Unfortunately the digits on the display are reversed. For example the transponder(Zibo737) should read "5236"- the display shows "6325).
hw_chr_display_set_text(display_chr_radio1, 0, 0, string.format("%07d", xsponder) ) works just fine. On the AM screen(bottom right) it display the proper INT readout from the sim, even when changing the squawk.
xsponder example - .siff
(2.14 KiB) Downloaded 63 times
I'm sure this has been discussed before but can't find the solution in the forum. Any help will be appreciated. Even with a test fixed code the digits are reversed. Photo of test bench.
xponder pix 3.jpeg
xponder pix 2.jpeg
xponder pix 1.jpeg

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

Re: 7 segment display reverse digits

#2 Post by Keith Baxter »

Hi,

Yes when using the MAX indexing is reversed.

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 

old pilot guy
Posts: 30
Joined: Wed Dec 25, 2019 8:55 pm

Re: 7 segment display reverse digits

#3 Post by old pilot guy »

Any suggestions on how to make it right? Works OK on 8 digit max7219 but these custom pcbs are reversed as you know.
I know that Mobiflight has a setting to reverse the digits. Unfortunately it is not too kind to Xplane

Thanks

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

Re: 7 segment display reverse digits

#4 Post by Keith Baxter »

Hi Just to clarify.

The MAX indices from the right to left whilst the 7 segs indices from left to right.
Some popular led/max boards take this into account. most others not.

This a dig of the MAX7219 and indixes from Right to left
ice_screenshot_20220821-180222.png
And these led's indixes from left to right.
ice_screenshot_20220821-182150.png
https://www.aliexpress.com/item/1005003 ... 1802zEjn9B


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: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: 7 segment display reverse digits

#5 Post by Keith Baxter »

:lol: : and off to the races we go...Joe :)

Keith
Last edited by Keith Baxter on Sun Aug 21, 2022 4:45 pm, edited 1 time in total.
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
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: 7 segment display reverse digits

#6 Post by jph »

you asked... :lol:
Hi Just to clarify.

The MAX indices from the right to left whilst the 7 segs indices from left to right.
Some popular led/max boards take this into account. most others not.
eh ? :shock:
It doesn't 'index' anything.
It all depends on how it is wired.
It is not a 'standard'. It is absolutely 100% up to the PCB designer.
Joe. CISSP, MSc.

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

Re: 7 segment display reverse digits

#7 Post by Keith Baxter »

jph wrote: Sun Aug 21, 2022 4:44 pm you asked... :lol:
Hi Just to clarify.

The MAX indices from the right to left whilst the 7 segs indices from left to right.
Some popular led/max boards take this into account. most others not.
eh ? :shock:
It doesn't 'index' anything.
It all depends on how it is wired.
It is not a 'standard'. It is absolutely 100% up to the PCB designer.
Yes but AM indexes from right to left because the popular 8 digit max7219 is configured such.
However if one builds a custom display then the digits are reversed. I know that because i have had that experience.

@Ralph perhaps there should be an option in the hardware

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 

old pilot guy
Posts: 30
Joined: Wed Dec 25, 2019 8:55 pm

Re: 7 segment display reverse digits

#8 Post by old pilot guy »

Here is the screenshot from Mobiflight. It is a simple task to reverse the digits. It would be nice if
AM had this choice.
mobiflight  reverse digits.png

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

Re: 7 segment display reverse digits

#9 Post by Keith Baxter »

old pilot guy wrote: Sun Aug 21, 2022 5:04 pm Here is the screenshot from Mobiflight. It is a simple task to reverse the digits. It would be nice if
AM had this choice.
mobiflight reverse digits.png
@Corjan @Ralph Please.

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
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: 7 segment display reverse digits

#10 Post by Ralph »

I think this is where the power of Lua comes in:

Code: Select all

string.reverse(tostring(your_squawk))
More information here.
https://www.educative.io/answers/how-to ... ing-in-lua

Post Reply