Visual Studio Ide for Arduino
https://www.visualmicro.com/forums/YaBB.pl
Visual Micro >> Usb/Serial/Udp Debugging >> Leading spaces are supressed in serial monitor
https://www.visualmicro.com/forums/YaBB.pl?num=1527172948

Message started by Joao tavares on May 24th, 2018 at 3:42pm

Title: Leading spaces are supressed in serial monitor
Post by Joao tavares on May 24th, 2018 at 3:42pm
In my Visual micro Version 1.1803.26 the leading spaces sent to the serial windows are suppressed what causes a lot of stress for someone trying to develop something without too much experience. I thought that I was doing something wrong. I tried with a different serial monitor and things are correct with the leading spaces
What is happening ? Why are not others speaking about this only something in 2013.
Best regards

Joao

Title: Re: Leading spaces are supressed in serial monitor
Post by Visual Micro on May 24th, 2018 at 3:51pm
Hi,

This only happens when in debug mode. If you switch the toolbar from Debug to Release and then upload you will see the spaces are not removed.

You can find a forum thread where it was discussed here

Thanks

Title: Re: Leading spaces are supressed in serial monitor
Post by Lookingooder on Aug 22nd, 2019 at 3:20pm
Thank you for reply.

Here is short test code:

Code (c++):
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>

const char* myssid = "AP MODE";                        //SSID AP MODE
const char* mypassword = "12345678"; //Password AP MODE


char output_buffer[5000] = "\
<!DOCTYPE html>\
<html>\
<head>\
  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\
  <title>Main page</title>\
</head>\
<body>\
                 What is Visual Micro?\
                                                                                                                                                                                                                                                                             \
                 Visual Micro is an so called extension for Microsoft Visual Studio 2017 and 2019 and\
                 for Atmel Studio 7 that allows any Arduino project to be developed, compiled, and\
                 then uploaded to any Arduino board, while taking benefit of the powerful features of Visual Studio and Atmel Studio.\
                                                                                                                                                                                                                                                                                               \
                 Visual Micro is fully compatible with the Arduino development environment and uses\
                 the same libraries, source code, and development tools. The difference lies\
                 in Visual Micro's user interface which provides an advanced and professional\
                 development environment, and allows for more advanced development than the existing Arduino IDE.\
                                                                                                                                                                                                                                                                                                                       \
                 What does the term IDE mean?\
                                                                                                                                                                                                                                                                                                                             \
                 In this documentation, you will often find the term \"IDE\". This is an industry\
                 standard term meaning¬† Integrated Development Environment, which is a software\
                 application that incorporates a source code editor, build tools such as a compiler\
                 and a debugging system. The IDE is used to write, edit, build, and test your software.\
                 Whilst Arduino's IDE provides a basic starter level IDE, Visual Micro in conjunction\
                 with Microsoft Visual Studio or Atmel Studio provides an enhanced and more functional IDE.\
     </body>\
</html>\
";

WiFiServer server(80);
ESP8266WebServer serverAP(80);

void handleRoot()
{
// serverAP.send(200, "text/html", "<h1>Connected</h1>");
     serverAP.send(200, "text/html", output_buffer);
}

void setup()
{
     Serial.begin(115200);
     Serial.println(output_buffer);
     Serial.println("\n=========================");

WiFi.mode(WIFI_AP);

//AP
IPAddress myIP =WiFi.softAP(myssid, mypassword);
serverAP.on("/", handleRoot);

serverAP.begin();

}//setup()

void loop()
{
serverAP.handleClient();
delay(100);
}//loop()

/*
*/


and outputs sent to E-mail

Title: Re: Leading spaces are supressed in serial monitor
Post by Visual Micro on Aug 22nd, 2019 at 3:25pm
Does the problem happen when to switch the tool bar to Release mode?

Title: Re: Leading spaces are supressed in serial monitor
Post by Visual Micro on Aug 27th, 2019 at 3:28pm
I have tested this and the trimming of white space only happens in Debug Mode. A Release compile shows all text including whitespace.

Maybe this was a bug in the older vs2013 version of visual micro. Did you try vs2017 o 2019?


Visual Studio Ide for Arduino » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2019. All Rights Reserved.