Hi, I browsed the code posted on github for a while and I wonder if it's (without modifications) possible to use espruino to parse script inside string.
char *script = "var temperature; ........";
I saw that espruino also works with interrupt routines and when used interactively, it has main loop doing various stuff, but that's not necessary for me.
If it's not possible without mods, I'd love to modify it and post it back. (But I could use some directions as the code is not that small.)
Use this: eval()
myProg = 'print("Hello world");';
Perfect, thank you :)
If you mean using Espruino directly from C code, you want something like:
JsVar *v = jsvNewFromString("......");
jsvUnLock(jspEvaluateVar(jsiGetParser(), lineToExecute, 0));
Note that EvaluateVar returns a result as well.
Espruino can't execute directly from char* strings (only from JsVar-based strings).
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem