Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic printing to the serial monitor (Read 3573 times)
bob dring
Newbies
*
Offline


Posts: 3
Location: sydney Australia
Joined: Apr 3rd, 2018
printing to the serial monitor
Apr 3rd, 2018 at 10:17am
Print Post  
I'm a newbie,
To be honest I'm not sure if the serial monitor window is part of Atmel studio 7 or visual micro.

I have been using the serial monitor with serial prints to show the results of my program.
How can I print so that the next print overlays and replaces the last one?
 
To be clear I mean that there is a carriage return but no line feed.

I tried printing \r but the cursor didn't back up

bob
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: printing to the serial monitor
Reply #1 - Apr 3rd, 2018 at 1:11pm
Print Post  
The serial monitor is currently forward only and works the same way as the one in the Arduino IDE.

However there have been a couple of similar requests recently so it might shortly be changed.

A \r or \r\n are carriage return and line feeds. Without them we would not be able to show new lines of text in the monitor.

These commands do the same thing
Serial.println()
Serial.println("Hello World")

If this request is implemented we would need to support some escape chars that are not used for other things.

The question currently is which escape chars should be used?

« Last Edit: Apr 3rd, 2018 at 2:11pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
bob dring
Newbies
*
Offline


Posts: 3
Location: sydney Australia
Joined: Apr 3rd, 2018
Re: printing to the serial monitor
Reply #2 - Apr 5th, 2018 at 2:30am
Print Post  
Hi VM,
Thanks for the reply.

It would be nice to have cursor movement escape codes.
I hope it happens one day.

Bob
PS I really like VM and I just upgraded to PRO
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: printing to the serial monitor
Reply #3 - Apr 5th, 2018 at 11:24am
Print Post  
Yes and thanks

It would help to have some feedback about escape code suggestions
  
Back to top
WWW  
IP Logged
 
bob dring
Newbies
*
Offline


Posts: 3
Location: sydney Australia
Joined: Apr 3rd, 2018
Re: printing to the serial monitor
Reply #4 - Apr 5th, 2018 at 12:32pm
Print Post  
Hi VM,
Re suggestions.

Well, we are talking about two different things. my original post was not about ESC codes. It was about implementing '\r' as just a standard carriage return, as at the moment it does nothing. The \n (newline)and \t (tab) work as expected. I think the problem lies in the method you use to display the serial monitor screen image in that doesn't allow for backward movements.

Implementing \r would allow users to print repeated values on the same line without scrolling the display. As an example I might display the current time and temperature.

loop()
{
actualTime=getTime();
actualTemp=getTemp();

Serial.print("Time     ");
Serial.print(actualTime); 
Serial.print("\t"); 
Serial.print("Temp     ");       
Serial.print(actualTemp);
Serial.print("\r"); 
}                   
where actualTime and actualTemp are string variables.

While it is true that many external serial monitor programs can do the above, there is difficulty in sharing the COM port with the arduino uploader.

-------------------------

Moving on to the additional subject of  escape codes.  I think these would be a minimal set. (taken from from Microsoft console virtual terminal sequences)

ESC A      Cursor Up by 1
ESC B      Cursor Down by 1
ESC C      Cursor Forward (Right) by 1
ESC D      Cursor Backward (Left) by 1

Bob
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint