Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import serial
  2. port = 'COM1'
  3.  
  4. ser = serial.Serial()
  5. ser.port=port
  6. ser.baudrate=9600
  7. ser.open()
  8. ser.write(b'q')
  9. ser.close()
  10.  
  11. Traceback (most recent call last):
  12. File "C:UsersMateuszDesktopserialpy.py", line 7, in <module>
  13. ser.open()
  14. File "C:Python37libsite-packagesserialserialwin32.py", line 62, in open
  15. raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
  16. serial.serialutil.SerialException: could not open port 'COM1': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement