7 segment displays - some questions for Matthew the maker of the libs

29 views
Skip to first unread message

Zet Weeh

unread,
Jan 19, 2026, 5:20:16 PMJan 19
to jallib
Hi Matthew
Hi Matthew

I have some question about the lib 'seven_segment' and 'seven_segment_multiplexer'.

1 It is possible to connect 4 displays but is it also possible to use 2 displays independent of the other 2?
For example: 2 digits for up to 99 and 2 digits for down from 99

2 How can I use the characters of the lib 'seven_segment' in 'seven_segment_multiplexer'?

3 Is it possible to get a sbyte (-4) on the display?

4 When I make 2 displays 'input' their displays are off; when I make them 'output again the last information on the displays is gone and the displays give the start information. Is it possible the information will come back on the displays?

Regards, Peet

Matthew Schinkel

unread,
Jan 21, 2026, 7:13:21 PMJan 21
to jallib

1) 4 digits, but “2+2 independent”?
Yes, but not with seven_segment_multiplexer = value / put(word), because that only formats one number across all digits. To do 2+2, you must set the digit buffer per position (each digit is updated independently by the ISR).

-- up:   0..99  (displayed on digits 1..0)
-- down: 0..99  (displayed on digits 3..2)
var byte up   = 23
var byte down = 99

procedure display_update_2plus2() is
   var byte tens
   var byte ones

   tens = up / 10
   ones = up - (tens * 10)
   _seven_segment_multiplexer_digit[0] = ones
   _seven_segment_multiplexer_digit[1] = tens

   tens = down / 10
   ones = down - (tens * 10)
   _seven_segment_multiplexer_digit[2] = ones
   _seven_segment_multiplexer_digit[3] = tens

   if up < 10 then
      _seven_segment_multiplexer_digit[1] = 27  -- space
   end if
end procedure

2) Using seven_segment characters in the multiplexer
The multiplexer already uses seven_from_digit(...). So you can show any seven_segment “character index” by putting that index into the digit buffer (e.g. 10 = “A”, 27 = space, 34 = “-”, etc.).

   _seven_segment_multiplexer_digit[0] = 10  -- "A"
   _seven_segment_multiplexer_digit[1] = 11  -- "b"
   _seven_segment_multiplexer_digit[3] = 27  -- "space"

3) Showing sbyte negative (e.g. -4)
Yes: display "-" (character index 34) on one digit and 4 on the other.

_seven_segment_multiplexer_digit[0] = 4   -- "4"
_seven_segment_multiplexer_digit[1] = 34  -- "-" (minus)

4) Digits set to input go blank; when set back to output the old value is gone
To blank/re-enable while keeping the previous value, keep multiplexing running and blank via the digit data (e.g., use space index 27) rather than changing pin direction.

Matt.

Zet Weeh

unread,
Jan 22, 2026, 5:33:18 PMJan 22
to jallib
Hi Matt

Thanks for your clear answer.
I'll get started on it this week.

Regards, Peet

Op donderdag 22 januari 2026 om 01:13:21 UTC+1 schreef Matthew Schinkel:

Zet Weeh

unread,
Feb 2, 2026, 5:08:48 PM (10 days ago) Feb 2
to jallib
Hi Matt
I tried to send you personel a question and maybe it was not succesfull.
So one another try. I spoke Rob J and he said it was not common on the user side to start an assignment with an underscore.
Is it possible to convert the assignment into a standard assignment with, for example, a procedure? So change _seven_segment_multiplexer_digit[] to seven_segment_multiplexer_one_digit[].
Rob J can then update the library so that everyone can use the command. I'm curious.
Greetings Peter
Op donderdag 22 januari 2026 om 23:33:18 UTC+1 schreef Zet Weeh:

Matthew Schinkel

unread,
Feb 3, 2026, 7:57:35 PM (9 days ago) Feb 3
to jallib
Hi yes, that would be fine.

When writing the library  _seven_segment_multiplexer_digit wasn't meant to be used in samples, but you found a good use for it.

Matthew Schinkel

unread,
Feb 4, 2026, 10:44:01 PM (8 days ago) Feb 4
to jallib

Zet Weeh

unread,
Feb 5, 2026, 4:25:24 PM (7 days ago) Feb 5
to jallib
Hi. We crossed each other.
I send this to Rob J.

procedure seven_segment_multiplexer_one_digit(byte in display,byte in character) is
_seven_segment_multiplexer_digit[display]  = character
end procedure

seven_segment_multiplexer_one_digit(2,3)

This is also possible.

seven_segment_multiplexer_one_digit(0,10)
seven_segment_multiplexer_one_digit(1,11)
seven_segment_multiplexer_one_digit(2,11)
seven_segment_multiplexer_one_digit(3,10)

I think you will immidiatly see what's comming on the displays :).

Regards Peter

Op donderdag 5 februari 2026 om 04:44:01 UTC+1 schreef Matthew Schinkel:
Reply all
Reply to author
Forward
0 new messages