Python Serial Problems - Raspberry Pi Forums


okay. i'm trying serial communications on raspberry pi.

code: select all

import serial import time arduino= serial.serial('/dev/ttyam0',9600) test.open() time.sleep(1) test.close() 
when run command keep getting error
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

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums