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

9 views
Skip to first unread message

Zet Weeh

unread,
Jan 19, 2026, 5:20:16 PM (4 days ago) Jan 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 PM (2 days ago) Jan 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 PM (17 hours ago) Jan 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:
Reply all
Reply to author
Forward
0 new messages