That is almost what I want, thank you, but now my problem is that I want to print the "S" and the number of the pin that is set to LOW only one time until the pin is set to HIGH and LOW again. I does not have the good word to explain myself because english is not my native language.
I have ten buttons connected to pin 0 to 10 on my arduino mega (I plan to put more in the future), and I have a C# program that read the serial data sent by the arduino, I want the arduino to send the pin that are LOW as fast as possible (the delay(50) was just to make it slower for me to read), but I dont want the arduino to always send data if possible.
It may be easier to manages this from the c# program but would like to know if there is a way to do it from the arduino