Python Forum
serial connection to Arduino - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: serial connection to Arduino (/thread-35328.html)



serial connection to Arduino - Jack9 - Oct-21-2021

Trying to connect pc windows 10 to arduino.
https://pythonforundergradengineers.com/python-arduino-LED.html
But I get this error when using the code examples given.
AttributeError: module 'serial' has no attribute 'Serial'


RE: serial connection to Arduino - buran - Oct-21-2021

It's hard to tell when we don't see the code and the full traceback, but I guess your own file is also named serial.py. Is that the case? Or do you have another file with that name? If yes, rename that file to something different.
In future always post the full traceback you get, in error tags


RE: serial connection to Arduino - Larz60+ - Oct-21-2021

you may find this of value: https://learn.adafruit.com/arduino-to-circuitpython


RE: serial connection to Arduino - Jack9 - Oct-22-2021

(Oct-21-2021, 09:03 AM)buran Wrote: It's hard to tell when we don't see the code and the full traceback, but I guess your own file is also named serial.py. Is that the case? Or do you have another file with that name? If yes, rename that file to something different.
In future always post the full traceback you get, in error tags

Thank you for your response. The file wasn't called serial.py. I did a search and did find junk left over from something called pyCharm which left some junk after I thought I had removed it. One of the files was serial something html
However today the problem seems to have resolved itself after I did some pip uninstall and pip install of serial and pyserial.


RE: serial connection to Arduino - Jack9 - Oct-22-2021

(Oct-21-2021, 09:47 AM)Larz60+ Wrote: you may find this of value: https://learn.adafruit.com/arduino-to-circuitpython

Thank you for your response.

Yes I have seen that but I am using the Arduino to interface code written for the PC to send and receive data from hardware sensors and actuators. Although not new to programming (at a self taught hobby level) I am new to Python which I figure I have to use or know how to use because much code today is written in Python. I have no problem programming the Arduino in C++.