Good afternoon All,
Problem:
Error, disabling serialEvent() for COM8
null
…when running a PROCESSING sketch
Environment
I have an Arduino Uno running an Ultrasonic sweep sketch and am trying to learn PROCESSING by snagging other peoples code and commenting it as i learn.
My PROCESSING version is 4.0b3
Discussion:
I have been receiving this error off and on now for weeks and not fully understanding the issues with this error.
I have researched this on this forum a fair amount and seen that others have had their code re-written or they have re-written their “problem” code in another language (PY).
The code i am snagging from others seems to work for their intended purpose and their PROCESSING code runs on my machine just fine. BUT, after I start updating and commenting it . It only worked well until i got to the serialEvent functions. I started by commenting the code for my own clarity and that is when I started getting the
“Error, disabling serialEvent() for COM8
null”
errors.
void serialEvent (Serial myPort) {
// starts reading data from the Serial Port
// reads the data from the Serial Port up to the character ‘.’ and puts it into the String variable “data”.
data = myPort.readStringUntil(’.’); // Read the string from the COM port (using “.” as the end-of-string delimiter
data = data.substring(0,data.length()-1); // determine the length of the string
Solution
Removing the comments between the void line and the first executable line definitely removed the error.
Putting them back in definitely brought the error back.
Conclusion
So at least for me, i am learning to NOT comment after a function definition in PROCESSING as this seems to cause the “Error, disabling serialEvent() for COM8” message.
additionally in the other posted code i researched before posting this every problem piece of code that was re-written also took out the comments in the problem code.
So i feel good in saying it is a placement of comments problem not peoples code (at least from my point of view).
hope this helps others.
Respectfully Submitted