That'll output a comma-separated list of numbers. If you want to output just the actual character you can use %c - jsiConsolePrintf("%c", in[i]);.
jsiConsolePrint itself expects a C string - that's a pointer to a list of characters that is terminated with a 0 character, so you won't be able to just pass in the character itself.
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.
jsiConsolePrintf
is likeprintf
(I'd google it)... It needs a format string at the start which specifies what the next arguments actually are.In Espruino I added some special format characters for JS variables, see this
So you want to do something like:
That'll output a comma-separated list of numbers. If you want to output just the actual character you can use
%c
-jsiConsolePrintf("%c", in[i]);
.jsiConsolePrint
itself expects a C string - that's a pointer to a list of characters that is terminated with a0
character, so you won't be able to just pass in the character itself.If you did want to use it, you'd have to do:
(Of course you could also use
jsiConsolePrintChar
, which is probably what you want)... anyway, it's just one of the many reasons that programming embedded devices in C is painful :)