v1.52 has fixed a memory leak problem according to https://github.com/espruino/Espruino/blob/master/ChangeLog The below program will run out the memory soon on Espruino v1.50 and now on v1.52 it works fine.
var bulbs=[0,0,1]; function rotate() { var temp = bulbs[0]; bulbs = bulbs.slice(1); bulbs.push(temp); digitalWrite(LED1, bulbs[0]); digitalWrite(LED2, bulbs[1]); digitalWrite(LED3, bulbs[2]); } var interval = setInterval(rotate, 50);
@hcchen started
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.
v1.52 has fixed a memory leak problem according to https://github.com/espruino/Espruino/blob/master/ChangeLog
The below program will run out the memory soon on Espruino v1.50 and now on v1.52 it works fine.
var bulbs=[0,0,1];
function rotate() {
var temp = bulbs[0];
bulbs = bulbs.slice(1);
bulbs.push(temp);
digitalWrite(LED1, bulbs[0]);
digitalWrite(LED2, bulbs[1]);
digitalWrite(LED3, bulbs[2]);
}
var interval = setInterval(rotate, 50);