virtualWrite to terminal adds unwated enters

Hi,

I am doing some stuf with the terminal for the first time.
First i found out that terminal.println() deosn’t really work that well.
It just puts random enters everywhere in a single string.

But Blynk.virtualWrite(V1) fixed that.
Then I came upon a new problem, i used this example from somwhere on the forum:

Blynk.virtualWrite(V1, "\n"
                   "   ___  __          __\n"
                   "  / _ )/ /_ _____  / /__\n"
                   " / _  / / // / _ \\/  '_/\n"
                   "/____/_/\\_, /_//_/_/\\_\\\n"
                   "       /___/ v." BLYNK_VERSION " on\n            " BLYNK_INFO_DEVICE "\n");
size_t ram = BlynkFreeRam();
Blynk.virtualWrite(V1, "\n Free RAM: ", ram);
String currentTime = String(hour()) + ":" + minute() + ":" + second();
String currentDate = String(day()) + "/" + month() + "/" + year();
Blynk.virtualWrite(V1, "\n ", currentTime, " ", currentDate);

wich works pretty good, but as you can see in this picture it after RAM: it just puts an enter, this is not suppost to do that… right? (in the picture form the guy that posted it it didn’t put that enter!).

its not that big off a problem, I can live with it… but it would be nice if it could get fixed.
because it would mean that I cant put a variable inbetween 2 string texts…
But maybe am just doing it wrong.

Isaak

@IDV the way you’ve posted your code, with single backticks at the beginning of each line, makes it very difficult to read.
Please re-post the code with triple backticks at the beginning g and end of the whole block of code.

Pete.

Did it.
I didn’t know how i had to do it.
Thx for the tip!

Isaak

Looks even worse!
The triple backticks need to be on a line of their own and you need to delete the leading spaces.

Pete.

Is it ok now?

Isaak

Yes, that’s now correct.

What are you trying to achieve here? Are you wanting to display something similar to the monitor serial output?
If so, there’s much simpler way, which is to re-direct your serial output to the Terminal widget. Using this method you just have to do serial prints rather than virtual writes.
If that’s what you wanted then I can show you how.

Alternatively, the simple solution to your current issue is to build a string with the data you require then send it to the Terminal widget.

Pete.

No this doesn’t have anything to do with the serial monitor.
I was just worried that if i use variables in between strings somewhere else in the programa that it would also put those enters.

but building a string with all the data is a good alternative solution!
Thx

Isaak