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

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

Re: Many questions about 7 segment display modules

#41 Post by Kaellis991 »

Keith,

Sounds good. i will see if I can get that schematic.
Last edited by Kaellis991 on Thu Mar 23, 2023 9:40 pm, edited 1 time in total.

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

Re: Many questions about 7 segment display modules

#42 Post by Keith Baxter »

Kaellis991 wrote: Thu Mar 23, 2023 8:26 pm Keith,

Sounds good. i will see if I can get that achematic.
Hi,

Actually just run this code and tell me what the display shows. I should be able to work it out. No need to worry propwash. Is the module MAX7219 based?

Code: Select all

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

-- Set text "12345" on display 0 (first), line 0
hw_chr_display_set_text(display_chr_id, 0, 0, "123456.05")
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

#43 Post by Kaellis991 »

Keith,

Yes it is a 7219. As soon as I get the thing wired up on my breadboard I will do that.
Thanks

57DC0949-9E15-4EB8-98EE-5842AAD751B2.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

#44 Post by Keith Baxter »

Kaellis991 wrote: Thu Mar 23, 2023 9:45 pm Keith,

Yes it is a 7219. As soon as I get the thing wired up on my breadboard I will do that.
Thanks


57DC0949-9E15-4EB8-98EE-5842AAD751B2.jpeg
Hi,

It is 01h38 by me now. I am waiting for the result or a image of the module when running that code. Please advise else I am off to bed and you will have to wait for 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

#45 Post by Kaellis991 »

Keith,

Sorry that I wasn't clearer on when I will be able to do the wiring. It has to wait until this weekend.

Kirk

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

Re: Many questions about 7 segment display modules

#46 Post by Keith Baxter »

Kaellis991 wrote: Fri Mar 24, 2023 2:22 pm Keith,

Sorry that I wasn't clearer on when I will be able to do the wiring. It has to wait until this weekend.

Kirk
Hi,

No worries. I will keep an eye out for the image and will revert with a solution of sorts.

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

#47 Post by Kaellis991 »

Keith,

I found some time this morning to connect the board and my Nano.
Here is the code I copied from you.
And a picture of the display running from my Nano.

image.png
IMG_6674.JPG

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

Re: Many questions about 7 segment display modules

#48 Post by Kaellis991 »

Keith,

I disconnected the arduino and reconnected, then ran the code and now get 506.54

IMG_6675.JPG

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

Re: Many questions about 7 segment display modules

#49 Post by Kaellis991 »

Just to play around with it I swapped the last two digits from .05 to .50
Now the display shows 056.54

So what is this telling us?

Obviously the display is reading right to left while the characters in the code are reading left to right.
5093A358-D164-45AB-9C10-3A9F87AA6F5F.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

#50 Post by Keith Baxter »

Kaellis991 wrote: Fri Mar 24, 2023 4:05 pm Keith,

I disconnected the arduino and reconnected, then ran the code and now get 506.54


IMG_6675.JPG
Hi,

That is a problem as the decimal is 2f but the display should have showed 50.654.

I want you to try this code. We might have to change it a lot to come up with a solution.
I have coded this way just so that it is easier to change things. We will optimize later.

Code: Select all

--Create a variable to simulate a value from the sim
sim_value = "123.05"

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

--format the string
sim_value =  string.format("% 9.3f",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 

Post Reply