Storing string from arduino to text file using python
问题 I am using this code to send a string from arduino to PC int i=0; void setup(){ Serial.begin(9600); // Open serial connection at a baud rate of 9600 pinMode(13, OUTPUT); //set pin13 in o/p mode } void loop(){ while(1) { Serial.write("10.028371,76.328873"); Serial.write('\0'); delay(1000); } } I need a python code that receives this string and store it in a text file as such.The arduino is transmitting this string continuously but i need it only once in the text file. I have written the below