<button onclick="Puck.write('\x10setTime(12345789);\\n')">Set The Time with x10</button>
I think it's to do with escaping in HTML, because you're in a string inside a string - note you have to do \\n for newline, not \n - maybe just doing \\x10 would fix it?
... and your puckCommand example wouldn't work, but for the other reason! Try changing \\n to \n in that one!
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.
Is it this bit that's not working?
I think it's to do with escaping in HTML, because you're in a string inside a string - note you have to do
\\n
for newline, not\n
- maybe just doing\\x10
would fix it?... and your
puckCommand
example wouldn't work, but for the other reason! Try changing\\n
to\n
in that one!