-
• #3
Perfect, thank you :)
-
• #4
If you mean using Espruino directly from C code, you want something like:
JsVar *v = jsvNewFromString("......"); jsvUnLock(jspEvaluateVar(jsiGetParser(), lineToExecute, 0)); jsvUnLock(v);
Note that EvaluateVar returns a result as well.
Espruino can't execute directly from char* strings (only from JsVar-based strings).
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.
Something like:
char *script = "var temperature; ........";
jspExecute(script); ?
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.)