Hi,
I'm new to Arduino and trying to teach myself to collect signals from Arduino using Python. Could somebody help me explain or troubleshoot this output?
I tested Arduino and it actually generating data. I am using Python 2.7 and Pyserial has been installed.
Thank you so much!!!
Hoang
CODE:
import serial
arduinoSerialData = serial.Serial('/dev/cu.usbmodem1411',9600)
while (1==1):
if (arduinoSerialData.inWaiting()>0):
myData = arduinoSerialData.readline()
print myData
OUTPUT:
RESTART: /Users/hoangnguyen/Desktop/Hoang Python code/arduino.py
Sometime, I receive this:
OUTPUT:
Traceback (most recent call last):
File "/Users/hoangnguyen/Desktop/Hoang Python code/python arduino communication.py", line 6, in
myData = arduinoSerialData.readline()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialposix.py", line 495, in read
raise SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')
SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)