im trying to use python to communicate with arduion via a serial connection and it works really well. I just want to know if its ok to keep giving a serial input to the arduino without any delay. This input will be given in an infinite loop.Something like this ( not exactly but an example)
while 4>1 :
ser.write('#')
as shown above # is sent to the arduino infinitely without any delay. Will this cause any harm to the arduino in a later stage? or is the arduino built to handle constant inptu?
It really depends on how fast that infinite loop will execute, and how fast you handle the data on the Arduino site.
I think the input buffer on Arduinos serial port is 128 bytes, and if you do not handle (read) the data before the buffer is full, your data will be lost, but no physical harm will be done to the board.
What is the purpose of this constant stream of data?
Maybee there's a better way to deal with your task at hand.
Another small python query. I have the following line to get serial input in python from the arduino
print ser.readline()
The problem with this line is that it waits for the arduino to send a serial and will not continue unless it fetches a serial input from the arduino. Is there a function in the python serial to check if there is any serial input present ( something like serial.available() in arduino ) and then only input serial? else just continue doing whatever else the python script is supposed to do?