I found no example or tutorial of this. If it can, how?
Let us use the following c file as example:
//What files do I include here???extern int getInputState(int pos);char* jsCode = "\function ShowInputsState()\{\ var res = '';\ for (var i = 0; i < 10; i++)\ {\ var state = getInputState(i);\ res += '\nState of Input ' + i + ' is: ' + state;\ }\ return res;\}\\print(ShowInputsState());\\";void main(){ //What do I do here to run the js code???}
//What files do I include here???
extern int getInputState(int pos);
char* jsCode = "\
function ShowInputsState()\
{\
var res = '';\
for (var i = 0; i < 10; i++)\
var state = getInputState(i);\
res += '\nState of Input ' + i + ' is: ' + state;\
}\
return res;\
\
print(ShowInputsState());\
";
void main()
{
//What do I do here to run the js code???
}
@user53337 started 10 years ago
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.
I found no example or tutorial of this. If it can, how?
Let us use the following c file as example: