Page 1 of 1

TM1637 Macro Bug

Posted: Thu Sep 10, 2026 1:01 pm
by Sanjay_Singh
Dear Team,

I am writing to report an issue I have encountered while using the TM1637 with 16 switches.

After connecting all 16 switches, I found that the output is being reported in the range of 0–15 instead of the expected 1–16. Additionally, the switch connected between SEG1 and K1 always returns an output of 0, regardless of its state.

This issue is affecting the functionality of my project, and I would appreciate your urgent attention and guidance on how to resolve it.

Thank you for your time. I look forward to your response.

Best regards,
San

Re: TM1637 Macro Bug

Posted: Thu Sep 10, 2026 9:44 pm
by mnfisher
A key press of 0..15 is probably more 'programmer' friendly - for example it allows array indexing (0..number of elements - 1) without issue? Modt computer languages work this way.

Failing that then just add 1 to the return value?

What module are you using ? The TM1637 is a 16 segment display - which keys are you using?

Re: TM1637 Macro Bug

Posted: Fri Sep 11, 2026 9:55 am
by Sanjay_Singh
@mnfisher

Sir,

“A key press of 0..15 is probably more ‘programmer’ friendly – for example it allows array indexing (0..number of elements - 1) without issue. Most computer languages work this way. Failing that, just add 1 to the return value?”

When all the keys are in the OFF state, the output is already 0. Since I need to use all 16 keys individually, I need to be able to distinguish between no key pressed and each of the 16 key presses. Therefore, I would require 17 distinct states in total: 0 for no key pressed, and 1–16 for the 16 keys.

At present, the key connected between SEG1 and K1 also returns 0, which makes it indistinguishable from the “no key pressed” condition. This is the main issue I am facing.

“What module are you using? The TM1637 is a 16 segment display – which keys are you using?”

It is custom-designed hardware. The TM1637 is a 6-digit, 7-segment LED display driver with support for scanning up to 16 key inputs.

Regards,
San

Re: TM1637 Macro Bug

Posted: Fri Sep 11, 2026 10:03 am
by mnfisher
Sorry, the key array I looked at returned 255 for 'no key'...

Martin

Re: TM1637 Macro Bug

Posted: Fri Sep 11, 2026 10:12 am
by chipfryer27
Hi

The only one I have used also returns 255 when no key is pressed.

Stupid question. Have you electrically verified connection between SEG1 and K1 to ensure it is operating correctly?

Regards

Re: TM1637 Macro Bug

Posted: Fri Sep 11, 2026 2:54 pm
by BenR
Many thanks for letting us know.

It looks like the sim does return 0 - 16 where 0 is no press and 1-16 are valid presses.

I've rolled out a fix for the v11 components that should allow the embedded code to work correctly like the sim.

Let us know how you're getting on.

Re: TM1637 Macro Bug

Posted: Sat Sep 12, 2026 6:40 am
by Sanjay_Singh
Ben,

I'm on V10!
Any help?

San

Re: TM1637 Macro Bug

Posted: Mon Sep 14, 2026 3:15 pm
by BenR
Hi San,

Fixed for you in v10 now too.

Please let us know your version when you're making a new topic (there should be a radio button allowing you to select your version) and this helps us to fix the problem for you ASAP.