Advice on using LED matrix

How does it work when it has 16 pins, and you need more for analog reading the joystick?

How the LEDs are connected.
Post a schematic.

PS: describe how your project should work.

Yes, what is the problem?
With display, you may be only able to light one pixel at any instant, the more leds showing the more time the rest are off and to the eye they all look dim.

Before WS28xx leds came out, people used led driver chips or shift registers often with transistor+resistor per led to achieve brightness of every ON led. All of those ways use 1 to 3 pins regardless of how many leds used (even 8x8x8 led cubes and one 10x10x10).

What you are doing with pin per row and column, the forum archives has or had code for the display part but people abandoned for using shift registers around 2010 or before then drivers then WS28xx when those became available. WS2811 only needs 1 data pin for a whole string of pixels.

When I think of matrix, I think of button matrix and even those are better done with input shift registers.

Ohhhhhhhh I see. I never realized that about my display function. TYSM!

For the money and work not needed and IO pins saved, I see WS28xx leds as the best deal. WS28xx are also RGB with 16 million colors+brightness choice. All the same or near brightness, less than 16 million but still amazingly many! You can set a background color for all then "draw" in contrasting color(s).
I have WS2811 12mm bulbs that are perfect as tree lights. Before covid I bought 5 neter strings with 50 bulbs each. I can cut them and splice, each buld has a tiny chip. Each light at full white (red, blue and green levels all 255) draws 60 mA but if my colors draw <= 255 total then 20 mA per bulb. I connect a power supply and 1 pin from my Uno is all the wiring needed. I do use the Fastled library to handle the data send as the timing is tricky, my code sets red/green/blue values in an array and executes a show() function (okay there is some set up!) and all the bulbs reflect the array values faster than eyes can see.

WS2812 RGB led strips simply project colors, the leds are close and the strips are 1 or 2 meters. You can make a TV screen as tall as a wall with those, Samsung did, it's not cheap!

ChatGPT can't code... and worse, makes the idea seem complex.

It looks like your "button press" is a joystick.

Your idea can be made on several devices. LED matrix, WS28xx matrix, OLED matrix:

  1. Read the joystick x, y, and select button values.
  2. If x is greater than the midpoint, move the dot right.
  3. If x is less than the midpoint, move the dot left.
  4. If y is greater than the midpoint, move the dot up.
  5. If y is less than the midpoint, move the dot down.
  6. If the dot reaches a boundary, keep it at the boundary.
  7. Do fancy stuff like making the button blink, clear screen, change color.
  8. Stop using ChatGPT.

The matrix wires could be used to make a button box, with a bag full of diodes, that would remove the need for the joystick.

Thank you for the advice.

Truthfully, I didn’t use chat gpt for this code. I wanted to when I was struggling with it, and found it used maps. I never learned maps so I ignored chat gpt, just kept messing with it till it devolved into this mess that work haha!

Your tips for simplifying helped anyway tho so thanks!