# Node-red-node-pi-sense-hat - can't get multiple commands to work

**URL:** <https://discourse.nodered.org/t/node-red-node-pi-sense-hat-cant-get-multiple-commands-to-work/450>\
**Category:** FAQs\
**Created:** [28 May 2018 15:21 UTC](https://discourse.nodered.org/t/node-red-node-pi-sense-hat-cant-get-multiple-commands-to-work/450 "2018-05-28T15:21:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 May 2018 15:21 UTC](https://discourse.nodered.org/t/node-red-node-pi-sense-hat-cant-get-multiple-commands-to-work/450/1 "2018-05-28T15:21:50Z")

</div>

Node-RED version: v0.18.7  
Node.js version: v8.11.2  
node-red-node-pi-sense-hat@0.0.15

Playing with the RPI Sense Hat and I can not get multiple commands to work in a single msg.payload.  
If I send one msg.payload with:  
`R`  
and a second with  
`0,0,red,0,7,#00ff00,7,7,yellow,7,0,0,0,255`  
I get the letter ‘R’ and each of the four corners is colored.

If I send one msg.payload with:  
`R\n0,0,red,0,7,#00ff00,7,7,yellow,7,0,0,0,255`  
which should do the same thing, instead you see the entire line scrolled across the display.

Here is a flow showing the issue:  
`[{"id":"caa66d9d.b7aed8","type":"inject","z":"c3525ae7.a368a8","name":"2) color the corners","topic":"","payload":"0,0,red,0,7,#00ff00,7,7,yellow,7,0,0,0,255","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":140,"wires":[["5c1e5753.660f78"]]},{"id":"f5761e7.f3c03e","type":"inject","z":"c3525ae7.a368a8","name":"display an R and color the corners","topic":"","payload":"R\\n0,0,red,0,7,#00ff00,7,7,yellow,7,0,0,0,255","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":240,"wires":[["da53dcd.f9aa2a"]]},{"id":"da53dcd.f9aa2a","type":"rpi-sensehat out","z":"c3525ae7.a368a8","name":"","x":470,"y":240,"wires":[]},{"id":"e9664a98.d0b4c8","type":"inject","z":"c3525ae7.a368a8","name":"1) display the character 'R'","topic":"","payload":"R","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":100,"wires":[["5c1e5753.660f78"]]},{"id":"9d757ff4.713ec","type":"comment","z":"c3525ae7.a368a8","name":"If you display a single letter and then color the corners it works/","info":"","x":290,"y":60,"wires":[]},{"id":"2941dc48.9acb5c","type":"comment","z":"c3525ae7.a368a8","name":"Combining the two does not work.","info":"","x":180,"y":200,"wires":[]},{"id":"5c1e5753.660f78","type":"rpi-sensehat out","z":"c3525ae7.a368a8","name":"","x":470,"y":120,"wires":[]}]`

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 May 2018 19:07 UTC](https://discourse.nodered.org/t/node-red-node-pi-sense-hat-cant-get-multiple-commands-to-work/450/5 "2018-05-29T19:07:07Z")

</div>

How are you including the `\n` in the string? If it is by the Inject node or Change node, for example, then they don’t know about escaped strings and will include a literal `\n` not a new-line character.

Try using a Function node to generate the payload with the `\n` in and you should see it work.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 May 2018 19:57 UTC](https://discourse.nodered.org/t/node-red-node-pi-sense-hat-cant-get-multiple-commands-to-work/450/7 "2018-05-29T19:57:42Z")

</div>

Ahhh I just saw this at the end of the inject node's 'Node Help:

> Note: To include a newline in a string you must use a Function node to create the payload.

I'll add this tidbit to the DOCUP thread and create a PR for it.
