How do you send binary messages that need to be specific in size?
For example I need to send 0x1 as 16 bits or other such combinations. I suspect sending it as a number would always send over 32bit integers?
Is there an elegant way to construct messages that consist of bytes/words/ints that you'd individually add together or do I have to build a string out of the values?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
How do you send binary messages that need to be specific in size?
For example I need to send 0x1 as 16 bits or other such combinations. I suspect sending it as a number would always send over 32bit integers?
Is there an elegant way to construct messages that consist of bytes/words/ints that you'd individually add together or do I have to build a string out of the values?
Thanks