7 segment display reverse digits

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

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

Re: 7 segment display reverse digits

#21 Post by jph »

That instrument doesn't work with the tm 1637 6 digit units, so are you offering that as well?., and all versions of the 6 digit?... there is more than one.. what about the CC version TM 1638. ? There are about 6 versions of those,!!.. where are you fitting those options Keith? Hmm?
Oh, and the direct muxed version using discrete transistors?
How big is this option box of yours going to be?
Oh, how about the two blocks of four digit? One from pw and the other from ae? They each need different options. The problem is that your instrument is just so limited :D

I dont give a damn what mobiflight does or doesnt do really, this is a different product. YOU are free to code all the possible options in code and call a lovely happy camper setup screen from your code, one that YOU write. You can also open a nice piccy of the spoon to feed them ;)
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

#22 Post by Keith Baxter »

Joe,

You did not read this obviously.
ice_screenshot_20220821-211845.png
And your thoughts on mobiflight remain yours. I do not care on those. But it remains that they have the foresight.


FFS it is a simple left/right indexing check box for the MAX7219.

Who said anything about anything else. The opening statement by the OP was...
"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."

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

#23 Post by old pilot guy »

I am a loyal AM customer and will remain so. I did try the string.reverse before I made my initial post.
Mobiflight has now added a direct link to X-Plane. All that is needed is to place the dataref or command in a box.
The only reason I brought up the subject in the first place is to stimulate some discussion and thought about the future.
"Rock on" AM. Thanks all.

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

Re: 7 segment display reverse digits

#24 Post by Keith Baxter »

old pilot guy wrote: Sun Aug 21, 2022 8:03 pm I am a loyal AM customer and will remain so. I did try the string.reverse before I made my initial post.
Mobiflight has now added a direct link to X-Plane. All that is needed is to place the dataref or command in a box.
The only reason I brought up the subject in the first place is to stimulate some discussion and thought about the future.
"Rock on" AM. Thanks all.
Hi,

Yes, My argument is that one should be able to swap indexing in the hw_add()
Also, some peeps might build their own displays like I did. Some might build PCB's for others.

If code is written in a instrument then a index swap should not be a train smash to implement in the hardware output. It is not a instrument thing. it is a hardware thing. The style of the output should be determined in the output device. Not in code

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
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: 7 segment display reverse digits

#25 Post by Sling »

Ralph already posted the sensible solution. Use a user property and provide support for both directions. You could do this for dial direction too if you wanted. It’s a bit naughty or lazy for the board makers to go opposite of the intended directions but I guess if it’s possible someone will do it.

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

Re: 7 segment display reverse digits

#26 Post by Keith Baxter »

Hi,

Whilst I get what all are saying I just feel that we are complicating things. I can tell you that a simple string reverse as a user property will not work.

The standard MAX7219 with 8 digits is wired like so. Pin from the IC to display digit

(max-disp) (0-8),(1-7),(2-6),(3-5),(4-4),(5-3),(6-2),(7-1)

The MAX7219 with 5 digits like the OP posted is wired like so.

(max-disp) (0-1),(1-2),(2-3),(3-4),(4-5)

I wire the MAX7219 with 5 digit like so.

(max-disp) (0-5),(1-4),(2-3),(3-2),(4-1)

Now by simply reversing the string then decimal places and string format go's out the window.

Code: Select all

display        = hw_chr_display_add("MAX7219", 2, "ARDUINO_MEGA2560_A_A0", "ARDUINO_MEGA2560_A_A2","ARDUINO_MEGA2560_A_A1")

--hw_chr_display_set_text(display , 0, 0,string.format("% 9.02f",string.reverse(tostring(123.876))))
hw_chr_display_set_text(display , 0, 0,string.format("% 9.02f",tostring(123.876)))

--hw_chr_display_set_text(display , 1, 0,string.reverse(tostring(123.876)))
hw_chr_display_set_text(display , 1, 0,tostring(123.876))
This is what
max1.png
max1.png (142.29 KiB) Viewed 813 times
max2.png
max2.png (147.76 KiB) Viewed 813 times
I will wire up two 5 digit displays later on today and take some images of what happens.

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

#27 Post by Keith Baxter »

Hi,

Just in case anyone is wondering I have built many MAX display configuration radios.
vhf2.jpg
ADF2.png
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
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: 7 segment display reverse digits

#28 Post by Corjan »

Hi,


In this case the API very clearly states it supports the MAX7219. And the MAX7219 has 8 channels, ranging DIG0 to DIG7.
This is exactly what AM does.
It doesn't clame to support one of the many hardware boards build around the MAX7219.

And I would rather not do that. New hardware designs come and go all the time. It is not something that should be baked into the AM application I think. It might be usefull to add a user property that can handle mulitple hardware vendors though.


Corjan

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

Re: 7 segment display reverse digits

#29 Post by Keith Baxter »

Corjan wrote: Mon Aug 22, 2022 8:29 am Hi,


In this case the API very clearly states it supports the MAX7219. And the MAX7219 has 8 channels, ranging DIG0 to DIG7.
This is exactly what AM does.
It doesn't clame to support one of the many hardware boards build around the MAX7219.

And I would rather not do that. New hardware designs come and go all the time. It is not something that should be baked into the AM application I think. It might be usefull to add a user property that can handle mulitple hardware vendors though.


Corjan
Corjan,

I understand. It is just that the standard MAX7219, The popular 8 digit one that we solder the cap on, works backwards.
In this diagram of the chip. DIG0 which is pin no 2 go's to digit no 8 on the display. That is the digit furthermost to the right.
ice_screenshot_20220821-180222.png
So the confusion now comes in when people buy a MAX7219 chip and a 5 digit led display. Logic tell us that the MAX DIG 0 pin should go to DIG1 on the display. But that is incorrect it should go to DIG5 on the display. So it might be that a person wires it up in reverse causing all sorts of confusion.

The OP bought MAX7219 that are wired max DIG0 -> display DIG1 hence the need to reverse the string and change string formatting.

I just thought that it might be easier to have direction argument than having to write code to swap or have a user prop.

But if that is not possible then at least this discussion has made peeps aware and how to overcome the situation.

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
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: 7 segment display reverse digits

#30 Post by Corjan »

Hi,


Yeah, so the conclusion here is that the board manufacturers don't make the most logical choices :)

It is very annoying to have to wait for a new build of AM/AP when there is a new hardware board.
So again this is easily fixed as user property, and hacking a bit with strings will get you there.


Might be smart for us to buy a couple of the most populair once, and support those in our hardware functions.

Corjan

Post Reply