I tried to use the example of DigitalReadSerial the problem is when i see the output on the serial monitor it gives me multiple of zeros then multiple of ones without giving any signal to the arduino without doing anything it gives zeros and ones so what shall i do for example if i want to read the signal coming to the arduino five times then make the output go on Led for example or run dc motor ?
If I understand your question, you're expecting something back from serial? That example doesn't read serial input... it reads the button on the pin, and sends that 0 or 1 to the serial interface which displays on the monitor as you saw. But it doesn't send anything back.
the code is the original code of the examples the problem without pressing on the push button it give in the serial monitor 0000000000 the 111111111 the 0000000 although i didnt press on the push button