4 digit, 7 segmented LED display module with rotary encoders

Hi,

I'm trying to build a geoache. I'd like to make a 4 digit display with the numbers 0000-9999 with 4 rotary encoders. The first rotary encoder only changes the first digit. Let say the code is 2222 , if the first rotary encoder is on 2 the led turns green, if its not the led turns red. So if the display reads 2342, the first and last led are green but the middle ones are red.

Now the problem is that I cannot find any good information to write that code. Nor do I know if it's easy to write or not. Does anyone know where to start?

Kind regards

Mark

Write to each digit individually, read each encoder individually. If the number being written to the display is not equal to the reading from then encoder, then turn on red led; if they are equal then turn on green led.

Question is what kind of hardware are you using? 0-9 time four displayed digits + four encoders + four red leds + 4 green leds = 16+16+4+4 = 40 I/O pins required.

Im using a TM1637_4 module board

I was planning to use 4 encoders and 4 fet switched red/green leds