How to get a `\` displayed in a message

I am messing about and need an animation to indicate things happening.

The old rotating character comes to mind.

and so on.

But I can't get the \ to work.

I've tried \\ but that didn't look right. Both \ were orange.... So probably not right.

As you have posted no details it's hard to tell what you issue is.

Have a look at the animated icons here

Use the fa-spin class to get any icon to rotate, and use fa-pulse to have it rotate with 8 steps. Works well with fa-spinner , fa-refresh , and fa-cog .

Depends on where you are using the .
In a function you need indeed 2x \ , both becomes orange and that's normal.
If you using the \ in for example an injection node one \ is sufficient.

You can always check with a debug node what's really in the message.

x = context.get("LAST") || 0;

if (x == 0)
    //  0
    msg.payload = "|@0,0";
} else
if (x == 1)
    //  1
    msg.payload = "/@0,0"
} else
if (x == 2)
    //  2
    msg.payload = "-@0,0";
} else

if (x == 3)
    //  3
    msg.payload = "*@0,0";
x = (x + 1) % 4;

msg.topic = "text";

return msg;

I have had to make the last one a * instead of a \.

This is being sent to a LCD. So I can't really use an icon. :frowning:

So when I try with:
msg.payload = "\\@0,0";

Both the \ are orange. I also tried it and it doesn't work.

Not sure what you want. (Edit: your previous post provided clarification.)

But even without programming you can get far, certainly not the best solution. But when it works ...




Error: Can't import. Not a JSON string.


Oh, a debug node would suffice for output.


Looking more at the code, there is/are/were 3 erroneous `'s at the end.
Removed them and works.

Modified the code in the above post :slight_smile:

Programmers probably hate this. :confused:

(Watch te animation at the bottom right of the page.)

Yeah, ok.

Alas it doesn't get me a useful output.

Could you help me in how to get it working with the function node code I posted?

Just for the sake of keeping it as small as possible, the code/node I posted is a lot better than .... 12 (?) nodes.

Oh, but on another thing:
Good to see I am not the only one who uses gate nodes!

They are great for a lot of things.

Have you put a debug on the output of the function node to see what is coming out?
Have you read the docs guide on Writing Functions which includes suggestions for using node.warn() to help debug functions?

In which scenario though?

If I make the line of interest
msg.payload = "\@0,0";

I get:
coming out of the node.

All others give their respective:

How do I get the node to spit out \@0,0?
That is what I need to see coming out of the node.

I've looked on sites and tried to find the magic to get the \ working.

I don't know the words to phrase the question to get a useful result from google.

Running char V2

Your code does the job I think. Small adjustment:

if (x == 3)
    //  3
    msg.payload = "\\@0,0";
1 Like


If I make the line:
\\@0,0 I get \@0,0 sent out.

In the node when typing both the \ were orange. So I thought that was..... another level of magic.

Screenshot from 2020-08-27 21-29-13

21:30 local. I think I had better call it a night.

Sorry. I'm stupid. (But that's a given.)

Not if I only have a single \. I need to make it double.

(That has opened another can of worms on the LCD. But it isn't critical.)

Just out of curiosity, what's wrong on the screen now? :slight_smile:

The LCD: when I send it a \ I get a ..... Yen symbol. Looks like a Y and a = mated.

This is not a big problem. This is a quick animation that is done as the machine reboots or shuts down.

So it isn't as smooth looking as it should be. It won't break the bank.

I just called in google.
Apparently backslash is not in it's ascii table.

You can get around it like this:

  • Use LCD.createChar () function.
  • Code: {0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00}, // BACKSLASH

More info and working code in the 5th post.

This info comes from an arduino forum, no idea if you can apply this. Anyway, it's fixable :slight_smile:

1 Like


This isn't really the project.
This display is one I have lying around.

I have a whole other can of worms with the 20x4 LCD I bought getting it working on a RasPi via I2C command.
Both are 3.3v, so don't panic.

A node I thought would just work isn't. Thought the person who wrote it has been helping me a lot.

But I think this (now) falls into Tomorrow's realm.

I need some food and sleep.
(But I will also need to learn how to upload characters too. But that is for the other display.)

No idea if this (click) works for your screen, but yeah ..
Good Luck anyway!

It can't hurt.

Edited the file as was told by the person who wrote the node. Set it to 0x72 and the display is now doing things.

Ok, using your example code where it sends 4 lines of text, I just get junk on the screen.
For the sake of eliminating things, I adjust the scroll speed.

I change it, close the window and DEPLOY.
The screen changes what it is showing. But it is still a mess. Nothing like what I am sending.

Mostly symbols.

Sorry. I got carried away. That was supposed to be for the person who wrote the node code.
But to keep you in the loop (if you want) progress has been made with the new display.

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