Now when I look at your photo.... spaghetti is the first word I can think of. And no it's not any critic of your wiring, but to me it makes no sense at all. Why don't you make a diagram och schematics instead, that will be of much more help to us.
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Can you post a version of your code with just the display code?
Did you write your code in stages?
If so you should have a simple display code.
it works thats why i am wondering and yes its the same as in the code that i added befor. I also found that i i put the sevseg.setNumber(2222); sevseg.refreshDisplay(); at the first thing at the loop it works. i will make a schematic now tho
What you haven't realised yet is that the display is multiplexed, but doesn't have it's own multiplexing driver chip, so the Arduino is performing the multiplexing. Specifically the SevSeg library is performing the multiplexing. In order to do that, it needs to refresh the display at least a couple of hundred times every second. But in your code, it only ever gets to do that when some serial characters are available to be read. Most of the time, there aren't any.
So as mentioned already, you need to move that sevseg.refreshDisplay() out of all the if statements. But you also need to remove that delay(100) because that will limit the SevSeg library to at most 10 updates per second, which will flicker like crazy.
EDIT: Sorry, you don't need to remove the delay(100) because that only happens when serial characters are available.
So just a simulation at this point? Ok... Looked from your post #1 that damage could already have been done.
Arduino simulators are very popular these days, but unfortunately they don't teach beginners about mistakes that would damage real components.
Do you know how to calculate what value of resistors you should use? The 220 or 330 ohm resistors commonly used with individual LEDs won't be high enough.