So I'm a beginner at Arduino and I have to light up an LED grid to show digits from 0-9. I wrote a bit of code (with the help of some people) and it's like 90% done but there's this ONE problem. I used a switch case to light up the LEDs (so if the user writes a 5 then the switch case will make the LEDs show the digit 5) but it only showed up for like a SPLIT second. So I put a while-loop in the switch cases to keep the LEDs lit up but now they can't go out anymore. I need the LEDs to stay lit and show the chosen digit until the user inputs a NEW digit in the serial plotter so then the LEDs stop showing the first digit but the new chosen digit and so forth. Here's a link to Tinkercad with my setup and code. And yes I'm aware that there's an issue with the code which makes the serial plotter take a '0' as '48', '1' as '49', '2' as '50', and so forth. This isn't THAT big of a deal but if someone could fix that as well then I would be even more grateful!
https://www.tinkercad.com/things/6AoINgjBqFr-led-matrix/editel