ESP32-S3 Not Responding to p5js serialcontrol

RyMayleas
Posts: 4
Joined: Thu Mar 12, 2026 12:18 am

ESP32-S3 Not Responding to p5js serialcontrol

Postby RyMayleas » Thu Mar 12, 2026 12:29 am

I have to test out a program written in p5js that uses the "p5.serialport.js" library, the "p5.serialControl" program, and an ESP32-S3 with a potentiometer connected to it. What was supposed to happen with the program was that a ball was supposed to change in size depending on what value the potentiometer was on and on the bottom was text showing what the value is. Every time I try to use it however, neither the ball nor the text would show up. I tried copying and pasting from my professor's code (under his permission) and it gave me the exact same result. Since the code works just fine on his board, we both believe there might be something wrong with my board. Does anyone else have this problem, and if you do, do you know how to fix it?

RyMayleas
Posts: 4
Joined: Thu Mar 12, 2026 12:18 am

Re: ESP32-S3 Not Responding to p5js serialcontrol

Postby RyMayleas » Thu Mar 12, 2026 5:09 pm

Addendum: Should've mentioned this in the original post, but at some point I added a call to the "serialEvent" function at the start of the "draw" function, and it seemed to have at least got the program closer to how it's supposed to function. The circle and text appeared and they would change based on the serial value it was given, but it seemed to be massively delayed as when I tilted the potentiometer, nothing happens, but it started changing when I didn't move the potentiometer. My professor told me that "serialEvent" should call automatically whenever new data arrives from the esp32, so that's why we think there might be something with the controller itself or maybe how it's set up.

RyMayleas
Posts: 4
Joined: Thu Mar 12, 2026 12:18 am

Re: ESP32-S3 Not Responding to p5js serialcontrol

Postby RyMayleas » Thu Mar 12, 2026 5:18 pm

Another Addendum: Scratch the part in the first addendum about the serial data being able to change because it's actually just stuck at -1. I think this happened after I changed the code to be closer to how my professor wrote.

RyMayleas
Posts: 4
Joined: Thu Mar 12, 2026 12:18 am

Re: ESP32-S3 Not Responding to p5js serialcontrol

Postby RyMayleas » Fri Mar 13, 2026 10:27 pm

Final Addendum: So my professor and I finally figured out what the problem was. The variable that was meant to store incoming serial data wasn't initialized and so that was causing an error which was what caused the program to not work. So we gave the variable an initial value of 0 and now the program works perfectly. I no longer need any help, but I'm keeping this thread so that others can know how to learn from my mistakes should they be in a similar situation.

Who is online

Users browsing this forum: No registered users and 3 guests