Trying send a string from python to arduino through serial port and resend a part of the same back <p>Problem is that it prints the string for some initial iterations but after that it prints only first letter of the string. <strong>THIS IS THE PYTHON CODE I'm USING:</strong></p> <pre><code>import serial import time ser = serial.Serial("COM5",9600) while True: ser.write('aqwertyui') time.sleep(1) print(ser.read()) ser.close </code></pre> <p><strong>This is arduino code I'm using</strong></p> <pre><code>#include&lt;SoftwareSerial.h&gt; SoftwareSerial mySerial(10,11); //RX TX char inc[8] = "0000000"; void setup() { // put your setup code here, to run once: Serial.begin(9600); mySerial.begin(9600); } int i; void loop() { while(mySerial.available()){ if(mySerial.read() == 'a'){ for(int i = 0; i&lt;8; i++){ if(i&lt;4){ inc[i] = '0'; inc[i] = mySerial.read(); mySerial.write(inc[i]); delay(1000); } else{ inc[i] = '0'; inc[i] = mySerial.read(); } } } else{ mySerial.write('0'); delay(1000); } } } </code></pre> <p><strong>This is my output</strong> q w e r q w e r .....for some iterations and then a a a a a a......till end.</p>