Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using USB
#1
So I have a USB to serial converter on /dev/ttyUSB0 and try writing to it but nothing happens:

#!/usr/bin/python


import serial
import sys

# Set Port
ser = serial.Serial('/dev/ttyUSB0', 57600, 8, 'N', 1, timeout=1)

ser.open()   # Reopen the port.

reset = "Hello World"
ser.write(reset)

time.sleep(.5)

print 'serial closed'
ser.close()
What am I doing wrong?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020