Guest User

Untitled

a guest
Jan 16th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. Traceback (most recent call last):
  2. File "C:UserscalebDocumentsCodingPythonThe Modern Python Bootcampfirst_program.py", line 4, in <module>
  3. s = serial.Serial('COM4', '9600' , timeout=0)
  4. File "C:UserscalebAppDataLocalProgramsPythonPython37-32libsite-packagesserialserialwin32.py", line 31, in __init__
  5. super(Serial, self).__init__(*args, **kwargs)
  6. File "C:UserscalebAppDataLocalProgramsPythonPython37-32libsite-packagesserialserialutil.py", line 240, in __init__
  7. self.open()
  8. File "C:UserscalebAppDataLocalProgramsPythonPython37-32libsite-packagesserialserialwin32.py", line 62, in open
  9. raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
  10. serial.serialutil.SerialException: could not open port 'COM4': PermissionError(13, 'Access is denied.', None, 5)
  11.  
  12. import serial
  13. import time
  14.  
  15. s = serial.Serial('COM4', '9600' , timeout=0)
  16.  
  17. while True:
  18. s.read()
  19.  
  20. ARDUINO CODE
  21. void setup() {
  22. // put your setup code here, to run once:
  23. Serial.begin(9600);
  24. }
  25.  
  26. void loop() {
  27. // put your main code here, to run repeatedly:
  28. Serial.write("hello worldn");
  29. delay(100);
  30. }
Add Comment
Please, Sign In to add comment