Creating a Static Serial Monitor

Hi everyone,

I am currently using a state machine on the Arduino to detect if water is present or not. The state machine checks for water every 100ms and if water is present, I have a message displaying on the serial monitor.

My problem is that the serial monitor displays the messages so fast that it is hard to read and determine the moment when water starts to be detected. I was wondering if there is a way to briefly display this message in the serial monitor, clear the monitor and then print the new message. Therefore, if the message is not changing the message on the serial monitor should appear static and only change when a different message is displayed.

Hi @prematurecorn ,
I don't know a way to do this.
You will have to do this by writing some routine in your scketch.

RV mineirin

Would it be helpful to show the message only when the input state changes ?

sounds like this is the current behavior and why you can't read a message.

seems that the code needs to queue messages and a message needs to delay displaying a different message by display a message a minimum amount of time

the queue can be a short array of strings the length of the display (i.e. strcpy()) a new message is not queued if it is already the last message on the queue. may need to keep track of when the message was queued

You cannot clear the serial monitor. There are terminal programs, like PuTTY, that will take ANSI escape sequences to clear the screen and manipulate the cursor (among other things).

Add another state. When state-A detects water and displays the message, go to state-B. State-B doesn't display the message.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.