Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback (most recent call last):
- File "C:UserscalebDocumentsCodingPythonThe Modern Python Bootcampfirst_program.py", line 4, in <module>
- s = serial.Serial('COM4', '9600' , timeout=0)
- File "C:UserscalebAppDataLocalProgramsPythonPython37-32libsite-packagesserialserialwin32.py", line 31, in __init__
- super(Serial, self).__init__(*args, **kwargs)
- File "C:UserscalebAppDataLocalProgramsPythonPython37-32libsite-packagesserialserialutil.py", line 240, in __init__
- self.open()
- File "C:UserscalebAppDataLocalProgramsPythonPython37-32libsite-packagesserialserialwin32.py", line 62, in open
- raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
- serial.serialutil.SerialException: could not open port 'COM4': PermissionError(13, 'Access is denied.', None, 5)
- import serial
- import time
- s = serial.Serial('COM4', '9600' , timeout=0)
- while True:
- s.read()
- ARDUINO CODE
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- Serial.write("hello worldn");
- delay(100);
- }
Add Comment
Please, Sign In to add comment