Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    What operating system do you use? Are you sure, that "com9" is the correct port, especially when the camera is connected? (as this might change) Can you connect the camera and then open the port in the Arduino IDE? Commented Sep 25, 2023 at 10:48
  • There is the remote possibility that you also opened the Serial Monitor of Arduino IDE when you connected the USB camera. This may seem unrelated, but the Serial Monitor blocks other programs from using that COM port while it is running. Commented Sep 25, 2023 at 11:21
  • when I tested the code, my IDE was basically closed @orithena Commented Sep 25, 2023 at 13:54
  • I use windows 10 when the camera is turned on in the device manager as well as before COM9 is busy with arduino mega @chrisl Commented Sep 25, 2023 at 13:56
  • If it works fine with one part but not the other, then it may be that both parts are attempting to use the same resources, or that your old run is still using a port and has not been killed. End your python piece with an exit call or simply del arduinoData Commented Sep 25, 2023 at 22:52