#!/usr/bin/env python import time import serial ser = serial.Serial( port='/dev/ttyAMA0', baudrate = 9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=1 ) counter=0 while 1: ser.write('Write counter: %d \n'%(counter)) time.sleep(1) counter += 1
Traceback (most recent call last): File "/home/pi/Desktop/serial.py", line 3, in <module> import serial File "/home/pi/Desktop/serial.py", line 6, in <module> ser=serial.Serial( AttributeError: 'module' object has no attribute 'Serial' >>>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)