Control 7seg display with multiple buttons

Hello!

I'm using the serial TM1637 7-segments display, which are controlled as described in this video
How to use TM1637 4 digits seven segment display with Arduino - YouTube, and in this datasheet
www.mcielectronics.cl/website_MCI/static/documents/Datasheet_TM1637.pdf (note p. 8).

Further, I have 4 buttons. And now, I want to control the display as follows:

  • If the first button is pressed one time, one segment of each number should light up.
  • If the first button is pressed a second time, two segments of each number should light up.
  • If the second button is pressed once, one segment of each number should light up.
  • If the second button is pressed twice, two segments of each number should light up.

And so on...

None of the segments activated by a second press needs to be the same as the one activated firstly. But all states are predefined, no varies from time to time.

I understand that some kind of AND/&&-based implementation of the different char arrays are needed. For example, when some keys have been pressed some amount of times, their segment contributions will overlap.

The purpose of the implementation is a kind of puzzle, where the competitor has to find out how to press the different keys to achieve true numbers on the screen.

Any suggestions of how a proper implementation of this could be done is much apprechiated!

To help out, we need some information from you.


Show us a proposed, good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.

Give links to components.



In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch of your attempt done so far.

Use the </> icon from the ‘reply menu’ to attach the copied sketch.

Ok, one moment and I'll sketch up the circuit.
Actual wiring does not exist yet.

Display www.electrokit.com/en/product/serial-display-7-seg-4-digit-tm1637
Buttons www.electrokit.com/en/product/push-button-pcb-12x12x8mm
Arduino: Playknowlogy Uno Rev. 3

Take a good close up picture of the foil (back) side of the display PCB and show it to us.