Python Serial Problems - Raspberry Pi Forums
okay. i'm trying serial communications on raspberry pi. when run command keep getting error
code: select all
import serial import time arduino= serial.serial('/dev/ttyam0',9600) test.open() time.sleep(1) test.close() traceback (most recent call last):
file "/home/pi/serial.py", line 1, in <module>
import serial
file "/home/pi/serial.py", line 3 in <module>
arduino= serial.serial('/dev/ttyam0',9600)
attributeerror: /module' object has no attribute 'serial'
just quick guess, python file called "serial.py", might have imported own file rather serial library. try changing file name "test-serial.py"
raspberrypi
Comments
Post a Comment