Elk: a restricted single-file JS engine for embedded systems https://github.com/cesanta/elk
it can be used from within the arduino development environment ...
Explore... Chat... Share...
sfranzyshen wrote:from the same people who brought you mongoose-os, mdash, mjs, and others ...
Elk: a restricted single-file JS engine for embedded systems https://github.com/cesanta/elk
it can be used from within the arduino development environment ...
Using library elk at version 0.0.16 in folder: /home/name/Arduino/libraries/elk
Sketch uses 280664 bytes (26%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28552 bytes (34%) of dynamic memory, leaving 53368 bytes for local variables. Maximum is 81920 bytes.
Sketch uses 231185 bytes (17%) of program storage space. Maximum is 1310720 bytes.
Global variables use 16396 bytes (5%) of dynamic memory, leaving 311284 bytes for local variables. Maximum is 327680 bytes.
#include "elk.h" // Add Elk library
extern "C" void myDelay(int milli) { delay(milli); }
extern "C" void myWrite(int pin, int val) { digitalWrite(pin, val); }
extern "C" void myMode(int pin, int mode) { pinMode(pin, mode); }
struct js *js;
void setup() {
js = js_create(malloc(700), 700);
js_import(js, "f1", (uintptr_t) myDelay, "vi");
js_import(js, "f2", (uintptr_t) myWrite, "vii");
js_import(js, "f3", (uintptr_t) myMode, "vii");
js_eval(js, "f3(2, 1);", 0); // Set LED pin to OUTPUT mode ... tried f3(2, 2) also ...
}
void loop() {
js_eval(js, "f1(200); f2(2, 1); f1(200); f2(2, 0);", 0);
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]