My idea is that I have 10 microcontrollers whose name will be 1... 10:
I want 1 to receive a number as input (from the user) and send it to 2.
2 will receive the number and add 10, and send the result to 3.
So each will add a number and send the result to the next microcontroller until it reaches 10.
10 will output the final output (output should be all the digits added by other processors in the input-received digital 1 +) chain).
I chose STM32F103C8 (blue pills) because they are cheaper and stronger than Arduino.
Now my question is how to connect my chosen microcontrollers (or suggested microcontrollers) to each other in the fastest and most effective way.
I'm not looking for the following suggestions: add an Ethernet / Bluetooth module and communicate with it between microcontrollers.
I'd like to ask for an explanation of how to connect them using serial or I2C connections or similar methods (if you can add detailed instructions, how to perform this operation accurately, which branches to connect to, etc.), I'll be happy, because I'm not very familiar with microcontrollers yet.
IIRC those processors have multiple serial ports, so you could have one port connected to the previous one, and another port connected to the next one (and run identical firmware on each one). (ie, UART1 of 1 is connected to UART2 on 2, 2's UART1 being connected to UART2 on 3, and so on).
Hell, if you only had one serial port, if the communication is only in one direction, you could tie the TX of 1 to the RX of 2, whose TX would be tied to 3, and so on.
Writing code to interface ovr serial is easier, particularly in a messy case like this where instead of a well defined master and slave, you have a series of peers talking to eachother in a chain like that. IIRC those processors also have multiple I2C and SPI ports, so you could have one acting as master and the other as slave, but you'd need someone very persuasive to convince me that those are better to use than a serial port for this sort of network.
That all said, your idea seems like a very contrived one - I can definitely imagine applications where that's a very logical and reasonable approach, but they're sort of corner cases, and from the way you talk, you don't seem very experienced, so I question whether your application is one where this sort of serial-communication daisy chain makes sense. Heck, I think this was one of the things I wanted to do when I first got interested in making the attiny841 (which has 2 serial ports) work with Arduino - but by the time I'd gotten the core working, I'd learned enough about Arduino to realize what I originally had in mind was a dumb idea.