-
-
Save andramalech/295a0c7f7ce06e9d055c87f75b85c4b7 to your computer and use it in GitHub Desktop.
This is the code that I have in the node which prepares data before it is sent to the Nextion serial protocol.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = msg.payload; | |
var buf = []; | |
for (var i=0, l = str.length; i < l; i++) { | |
var ascii = str.charCodeAt(i); | |
buf.push(ascii); | |
} | |
buf.push(255); | |
buf.push(255); | |
buf.push(255); | |
msg.payload = new Buffer(buf); | |
return msg; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment