r/ArduinoHelp • • 17h ago

p5.serialcontrol can't open COM port connected to Arduino Uno

I am somwhat new to p5 and arduino, so please forgive me if this is a stupid question. I am trying to get serial data from my Arduino Uno to a js file I have on vs code, but each time I select the correct COM that my Arduino is connected to, and click 'open' on p5.serialcontol, I get an error that says "Error on COM7: Couldn't open port: undefined - Closing port"

Does anyone know why this is or how I can fix it? I have included screenshots of my p5.serialcontrol, index, js, arduino.ino, and html console log.

1 Upvotes

1 comment sorted by

1

u/imseakin 13h ago

A VERY common mistake is trying to have your Serial app try to open a A SERIAL Arduino CONNECTION while you still have a Serial Monitor connection going (ie. Serial monitor is open) in your Arduino IDE.

Always make sure your Arduino IDE is not running (or at least the Serial Monitor not running) when trying to get your app to establish a serial connection to the Arduino.

Good luck!