software turn on of serial monitor

I’d like to turn on the serial monitor using code within the sketch. Any ideas.

I’ve done all kinds of searches and no luck.

hoke

I vaguely remember this coming up before and the answer was "no", alas. I think it would be an excellent feature.

This.....

Serial.monitor(open);
Serial.monitor(close);

.....would be awesome.

If the serial monitor is closed and the IDE is not actually uploading a sketch the IDE is not connected to the Arduino board. I use other software to communicate with the Arduino and I routinely upload a new sketch and then restart my comms software on the same serial connection - there is never a conflict.

What that means is that the IDE would not hear a SerialMonitor.open() command - although I guess the Serial Monitor could hear SM.close().

...R

This.....

Code:

Serial.monitor(open); Serial.monitor(close);

.....would be awesome.

So, with nothing on the PC end monitoring the serial port, please explain how that would be implemented.

I'm new to this stuff and trying to learn.

I was hoping that there was a way to implement the "ctl/shift/M" via ascii or hex commands to turn on the monitor window. Any ideas along that line?

hoke

If you had a Leonardo or similar, which has a USB keyboard emulation, you could conceivably send that sequence, however the Arduino IDE would need to have the focus, otherwise Photoshop or some other app would get it.